From 0f9d45b2e829b6c988092132cf6714f6a3362c64 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 12 Jun 2020 13:02:57 +0800 Subject: [PATCH] chore(v3): add __tests__ --- .../__tests__/compiler-app-plus-extra.service.spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js b/packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js index 95fad8a6..addccc45 100644 --- a/packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js +++ b/packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js @@ -86,7 +86,11 @@ describe('codegen', () => { ) }) - it('generate v-slot', () => { + it('generate v-slot', () => { + assertCodegen( + '', + `with(this){return _c('view',_l((_$s(1,'f',{forItems:list})),function(el,ind,$20,$30){return _c('view',{key:_$s(1,'f',{forIndex:$20,key:ind})},[_c('test-component',{attrs:{"list":el,"_i":("2-"+$30)},scopedSlots:_u([{key:"test",fn:function({ sendList }, _svm, _si){return _l((_svm._$s((4+'-'+$30+"-"+_si),'f',{forItems:sendList})),function(item,index,$21,$31){return _c('view',{key:_svm._$s((4+'-'+$30+"-"+_si),'f',{forIndex:$21,key:index}),attrs:{"_i":(("4-"+_si)+$30+'-'+$31)}})})}}],null,true)})],1)}),0)}` + ) assertCodegen( '{{ user.firstName }}', `with(this){return _c('current-user',{attrs:{"_i":0},scopedSlots:_u([{key:"default",fn:function({ user }, _svm, _si){return [_v((_svm._$s(("0-"+_si),'t0-0',_s(user.firstName))))]}}])})}` -- GitLab