|
@@ -52,6 +52,10 @@ export function generate (
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function genElement (el: ASTElement, state: CodegenState): string {
|
|
export function genElement (el: ASTElement, state: CodegenState): string {
|
|
|
|
|
+ if (el.parent) {
|
|
|
|
|
+ el.pre = el.pre || el.parent.pre
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (el.staticRoot && !el.staticProcessed) {
|
|
if (el.staticRoot && !el.staticProcessed) {
|
|
|
return genStatic(el, state)
|
|
return genStatic(el, state)
|
|
|
} else if (el.once && !el.onceProcessed) {
|
|
} else if (el.once && !el.onceProcessed) {
|
|
@@ -70,7 +74,10 @@ export function genElement (el: ASTElement, state: CodegenState): string {
|
|
|
if (el.component) {
|
|
if (el.component) {
|
|
|
code = genComponent(el.component, el, state)
|
|
code = genComponent(el.component, el, state)
|
|
|
} else {
|
|
} else {
|
|
|
- const data = el.plain ? undefined : genData(el, state)
|
|
|
|
|
|
|
+ let data
|
|
|
|
|
+ if (!el.plain || el.pre) {
|
|
|
|
|
+ data = genData(el, state)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const children = el.inlineTemplate ? null : genChildren(el, state, true)
|
|
const children = el.inlineTemplate ? null : genChildren(el, state, true)
|
|
|
code = `_c('${el.tag}'${
|
|
code = `_c('${el.tag}'${
|