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
|
// 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.
|
// the AST location info to be relative to the entire SFC.
|
||||||
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
|
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
|
||||||
|
...compilerOptions,
|
||||||
parseMode: 'sfc',
|
parseMode: 'sfc',
|
||||||
onError: e => errors.push(e),
|
onError: e => errors.push(e),
|
||||||
})
|
})
|
||||||
|
|
|
@ -70,8 +70,8 @@ const sfcOptions: SFCOptions = {
|
||||||
template: {
|
template: {
|
||||||
isProd: useProdMode.value,
|
isProd: useProdMode.value,
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
isCustomElement: (tag: string) => tag === 'mjx-container'
|
isCustomElement: (tag: string) => tag === 'mjx-container',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue