@@ -112,8 +112,7 @@ describe('codegen', () => {
112112 it ( 'generate slot fallback content' , ( ) => {
113113 assertCodegen (
114114 '<slot><div>hi</div></slot>' ,
115- `with(this){return _t("default",[_m(0)])}` ,
116- [ `with(this){return _h('div',["hi"])}` ]
115+ `with(this){return _t("default",[_h('div',["hi"])])}`
117116 )
118117 } )
119118
@@ -128,8 +127,7 @@ describe('codegen', () => {
128127 // static
129128 assertCodegen (
130129 '<p class="class1">hello world</p>' ,
131- 'with(this){return _m(0)}' ,
132- [ `with(this){return _h('p',{staticClass:"class1"},["hello world"])}` ]
130+ `with(this){return _h('p',{staticClass:"class1"},["hello world"])}` ,
133131 )
134132 // dynamic
135133 assertCodegen (
@@ -169,8 +167,7 @@ describe('codegen', () => {
169167 it ( 'generate static attrs' , ( ) => {
170168 assertCodegen (
171169 '<input name="field1">' ,
172- `with(this){return _m(0)}` ,
173- [ `with(this){return _h('input',{attrs:{"name":"field1"}})}` ]
170+ `with(this){return _h('input',{attrs:{"name":"field1"}})}`
174171 )
175172 } )
176173
@@ -297,22 +294,22 @@ describe('codegen', () => {
297294 it ( 'generate component with inline-template' , ( ) => {
298295 // have "inline-template'"
299296 assertCodegen (
300- '<my-component inline-template><p>hello world</p></my-component>' ,
301- `with(this){return _h('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _h('p',["hello world"])}}]}})}`
297+ '<my-component inline-template><p><span> hello world</span> </p></my-component>' ,
298+ `with(this){return _h('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _h('p',[_h('span',[ "hello world"]) ])}}]}})}`
302299 )
303300 // "have inline-template attrs, but not having extactly one child element
304301 assertCodegen (
305302 '<my-component inline-template><hr><hr></my-component>' ,
306- `with(this){return _h('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _h('hr')}}]}})}`
303+ `with(this){return _h('my-component',{inlineTemplate:{render:function(){with(this){return _h('hr')}},staticRenderFns:[ ]}})}`
307304 )
308305 expect ( 'Inline-template components must have exactly one child element.' ) . toHaveBeenWarned ( )
309306 } )
310307
311308 it ( 'generate static trees inside v-for' , ( ) => {
312309 assertCodegen (
313- `<div><div v-for="i in 10"><span></span></div></div>` ,
310+ `<div><div v-for="i in 10"><p>< span></span></p ></div></div>` ,
314311 `with(this){return _h('div',[_l((10),function(i){return _h('div',[_m(0,true)])})])}` ,
315- [ `with(this){return _h('span')}` ]
312+ [ `with(this){return _h('p',[_h(' span')] )}` ]
316313 )
317314 } )
318315
0 commit comments