@@ -57,14 +57,14 @@ describe('codegen', () => {
5757 it ( 'generate v-if directive' , ( ) => {
5858 assertCodegen (
5959 '<p v-if="show">hello</p>' ,
60- `with(this){return (show)?_h(_e('p'),[_t( "hello") ]):void 0}`
60+ `with(this){return (show)?_h(_e('p'),["hello"]):void 0}`
6161 )
6262 } )
6363
6464 it ( 'generate v-else directive' , ( ) => {
6565 assertCodegen (
6666 '<div><p v-if="show">hello</p><p v-else>world</p></div>' ,
67- `with(this){return _h(_e('div'),[(show)?_h(_e('p'),[_t( "hello") ]):_h(_e('p'),[_t( "world") ])])}`
67+ `with(this){return _h(_e('div'),[(show)?_h(_e('p'),["hello"]):_h(_e('p'),["world"])])}`
6868 )
6969 } )
7070
@@ -91,15 +91,15 @@ describe('codegen', () => {
9191
9292 it ( 'generate template tag' , ( ) => {
9393 assertCodegen (
94- '<template><p>hello world </p></template>' ,
95- `with(this){return [_h(_e('p'),[_t(" hello world" )])]}`
94+ '<template><p>{{ hello}} </p></template>' ,
95+ `with(this){return [_h(_e('p'),[_s( hello)])]}`
9696 )
9797 } )
9898
9999 it ( 'generate svg tag' , ( ) => {
100100 assertCodegen (
101101 '<svg><text>hello world</text></svg>' ,
102- `with(this){return _h(_e('svg',void 0,'svg'),[_h(_e('text',void 0,'svg'),[_t( "hello world") ])])}`
102+ `with(this){return _h(_e('svg',void 0,'svg'),[_h(_e('text',void 0,'svg'),["hello world"])])}`
103103 )
104104 } )
105105
@@ -131,14 +131,14 @@ describe('codegen', () => {
131131 assertCodegen (
132132 '<slot><div>hi</div></slot>' ,
133133 `with(this){return ($slots["default"]||[_m(0)])}` ,
134- [ `with(this){return _h(_e('div'),[_t( "hi") ])}` ]
134+ [ `with(this){return _h(_e('div'),["hi"])}` ]
135135 )
136136 } )
137137
138138 it ( 'generate slot target' , ( ) => {
139139 assertCodegen (
140140 '<p slot="one">hello world</p>' ,
141- `with(this){return _h(_e('p',{slot:"one"}),[_t( "hello world") ])}`
141+ `with(this){return _h(_e('p',{slot:"one"}),["hello world"])}`
142142 )
143143 } )
144144
@@ -147,40 +147,40 @@ describe('codegen', () => {
147147 assertCodegen (
148148 '<p class="class1">hello world</p>' ,
149149 'with(this){return _m(0)}' ,
150- [ `with(this){return _h(_e('p',{staticClass:"class1"}),[_t( "hello world") ])}` ]
150+ [ `with(this){return _h(_e('p',{staticClass:"class1"}),["hello world"])}` ]
151151 )
152152 // dynamic
153153 assertCodegen (
154154 '<p :class="class1">hello world</p>' ,
155- `with(this){return _h(_e('p',{class:class1}),[_t( "hello world") ])}`
155+ `with(this){return _h(_e('p',{class:class1}),["hello world"])}`
156156 )
157157 } )
158158
159159 it ( 'generate style binding' , ( ) => {
160160 assertCodegen (
161161 '<p :style="error">hello world</p>' ,
162- `with(this){return _h(_e('p',{style:(error)}),[_t( "hello world") ])}`
162+ `with(this){return _h(_e('p',{style:(error)}),["hello world"])}`
163163 )
164164 } )
165165
166166 it ( 'generate transition' , ( ) => {
167167 assertCodegen (
168168 '<p transition="expand">hello world</p>' ,
169- `with(this){return _h(_e('p',{transition:"expand"}),[_t( "hello world") ])}`
169+ `with(this){return _h(_e('p',{transition:"expand"}),["hello world"])}`
170170 )
171171 } )
172172
173173 it ( 'generate dynamic transition with transition on appear' , ( ) => {
174174 assertCodegen (
175175 `<p :transition="{name:'expand',appear:true}">hello world</p>` ,
176- `with(this){return _h(_e('p',{transition:{name:'expand',appear:true}}),[_t( "hello world") ])}`
176+ `with(this){return _h(_e('p',{transition:{name:'expand',appear:true}}),["hello world"])}`
177177 )
178178 } )
179179
180180 it ( 'generate v-show directive' , ( ) => {
181181 assertCodegen (
182182 '<p v-show="shown">hello world</p>' ,
183- `with(this){return _h(_e('p',{directives:[{name:"show",value:(shown),expression:"shown"}],show:true}),[_t( "hello world") ])}`
183+ `with(this){return _h(_e('p',{directives:[{name:"show",value:(shown),expression:"shown"}],show:true}),["hello world"])}`
184184 )
185185 } )
186186
@@ -292,7 +292,7 @@ describe('codegen', () => {
292292 assertCodegen (
293293 '<my-component name="mycomponent1" :msg="msg" @notify="onNotify"><div>hi</div></my-component>' ,
294294 `with(this){return _h(_e('my-component',{attrs:{"msg":msg},staticAttrs:{"name":"mycomponent1"},on:{"notify":onNotify}}),function(){return [_m(0)]})}` ,
295- [ `with(this){return _h(_e('div'),[_t( "hi") ])}` ]
295+ [ `with(this){return _h(_e('div'),["hi"])}` ]
296296 )
297297 } )
298298
@@ -311,7 +311,7 @@ describe('codegen', () => {
311311 // have "inline-template'"
312312 assertCodegen (
313313 '<my-component inline-template><p>hello world</p></my-component>' ,
314- `with(this){return _h(_e('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _h(_e('p'),[_t( "hello world") ])}}]}}))}`
314+ `with(this){return _h(_e('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _h(_e('p'),["hello world"])}}]}}))}`
315315 )
316316 // "have inline-template attrs, but not having extactly one child element
317317 assertCodegen (
@@ -330,7 +330,7 @@ describe('codegen', () => {
330330 it ( 'not specified directives option' , ( ) => {
331331 assertCodegen (
332332 '<p v-if="show">hello world</p>' ,
333- `with(this){return (show)?_h(_e('p'),[_t( "hello world") ]):void 0}` ,
333+ `with(this){return (show)?_h(_e('p'),["hello world"]):void 0}` ,
334334 { isReservedTag }
335335 )
336336 } )
@@ -341,7 +341,7 @@ describe('codegen', () => {
341341 assertCodegen (
342342 '<div><p>hello world</p></div>' ,
343343 `with(this){return _m(0)}` ,
344- [ `with(this){return _h(_e('div'),function(){return [_h(_e('p'),function(){return [_t( "hello world") ]})]})}` ] ,
344+ [ `with(this){return _h(_e('div'),function(){return [_h(_e('p'),function(){return ["hello world"]})]})}` ] ,
345345 { directives }
346346 )
347347 } )
0 commit comments