mirror of https://github.com/vuejs/core.git
fix(compiler-sfc): use compilerOptions when re-parsing consumed AST
fixes hydration error for custom elements
This commit is contained in:
parent
be7eabda22
commit
d94d8d4bff
|
@ -219,6 +219,7 @@ function doCompileTemplate({
|
|||
// We need to parse a fresh one. Can't just use `source` here since we need
|
||||
// the AST location info to be relative to the entire SFC.
|
||||
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
|
||||
...compilerOptions,
|
||||
parseMode: 'sfc',
|
||||
onError: e => errors.push(e),
|
||||
})
|
||||
|
|
|
@ -70,8 +70,8 @@ const sfcOptions: SFCOptions = {
|
|||
template: {
|
||||
isProd: useProdMode.value,
|
||||
compilerOptions: {
|
||||
isCustomElement: (tag: string) => tag === 'mjx-container'
|
||||
}
|
||||
isCustomElement: (tag: string) => tag === 'mjx-container',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue