|
@@ -232,25 +232,25 @@ describe('codegen', () => {
|
|
|
it('generate dynamic scoped slot', () => {
|
|
it('generate dynamic scoped slot', () => {
|
|
|
assertCodegen(
|
|
assertCodegen(
|
|
|
'<foo><template :slot="foo" slot-scope="bar">{{ bar }}</template></foo>',
|
|
'<foo><template :slot="foo" slot-scope="bar">{{ bar }}</template></foo>',
|
|
|
- `with(this){return _c('foo',{scopedSlots:_u([{key:foo,fn:function(bar){return [_v(_s(bar))]}}],true)})}`
|
|
|
|
|
|
|
+ `with(this){return _c('foo',{scopedSlots:_u([{key:foo,fn:function(bar){return [_v(_s(bar))]}}],null,true)})}`
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('generate scoped slot with multiline v-if', () => {
|
|
it('generate scoped slot with multiline v-if', () => {
|
|
|
assertCodegen(
|
|
assertCodegen(
|
|
|
'<foo><template v-if="\nshow\n" slot-scope="bar">{{ bar }}</template></foo>',
|
|
'<foo><template v-if="\nshow\n" slot-scope="bar">{{ bar }}</template></foo>',
|
|
|
- `with(this){return _c('foo',{scopedSlots:_u([{key:"default",fn:function(bar){return (\nshow\n)?[_v(_s(bar))]:undefined}}],true)})}`
|
|
|
|
|
|
|
+ `with(this){return _c('foo',{scopedSlots:_u([{key:"default",fn:function(bar){return (\nshow\n)?[_v(_s(bar))]:undefined}}],null,true)})}`
|
|
|
)
|
|
)
|
|
|
assertCodegen(
|
|
assertCodegen(
|
|
|
'<foo><div v-if="\nshow\n" slot="foo" slot-scope="bar">{{ bar }}</div></foo>',
|
|
'<foo><div v-if="\nshow\n" slot="foo" slot-scope="bar">{{ bar }}</div></foo>',
|
|
|
- `with(this){return _c(\'foo\',{scopedSlots:_u([{key:"foo",fn:function(bar){return (\nshow\n)?_c(\'div\',{},[_v(_s(bar))]):_e()}}],true)})}`
|
|
|
|
|
|
|
+ `with(this){return _c(\'foo\',{scopedSlots:_u([{key:"foo",fn:function(bar){return (\nshow\n)?_c(\'div\',{},[_v(_s(bar))]):_e()}}],null,true)})}`
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('generate scoped slot with new slot syntax', () => {
|
|
it('generate scoped slot with new slot syntax', () => {
|
|
|
assertCodegen(
|
|
assertCodegen(
|
|
|
'<foo><template v-if="show" #default="bar">{{ bar }}</template></foo>',
|
|
'<foo><template v-if="show" #default="bar">{{ bar }}</template></foo>',
|
|
|
- `with(this){return _c('foo',{scopedSlots:_u([(show)?{key:"default",fn:function(bar){return [_v(_s(bar))]}}:null],true)})}`
|
|
|
|
|
|
|
+ `with(this){return _c('foo',{scopedSlots:_u([(show)?{key:"default",fn:function(bar){return [_v(_s(bar))]}}:null],null,true)})}`
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
|
|
|