+8
-1
lines changedFilter options
+8
-1
lines changed Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ function genDirectives (el: ASTElement, state: CodegenState): string | void {
309
309
function genInlineTemplate (el: ASTElement, state: CodegenState): ?string {
310
310
const ast = el.children[0]
311
311
if (process.env.NODE_ENV !== 'production' && (
312
-
el.children.length > 1 || ast.type !== 1
312
+
el.children.length !== 1 || ast.type !== 1
313
313
)) {
314
314
state.warn('Inline-template components must have exactly one child element.')
315
315
}
Original file line number Diff line number Diff line change
@@ -455,7 +455,14 @@ describe('codegen', () => {
455
455
'<my-component inline-template><hr><hr></my-component>',
456
456
`with(this){return _c('my-component',{inlineTemplate:{render:function(){with(this){return _c('hr')}},staticRenderFns:[]}})}`
457
457
)
458
+
try {
459
+
assertCodegen(
460
+
'<my-component inline-template></my-component>',
461
+
''
462
+
)
463
+
} catch (e) {}
458
464
expect('Inline-template components must have exactly one child element.').toHaveBeenWarned()
465
+
expect(console.error.calls.count()).toBe(2)
459
466
})
460
467
461
468
it('generate static trees inside v-for', () => {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4