From b043eb7ee5bbab3f4beac7d9a804bcff47077770 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 30 Jul 2024 16:52:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(v-slot):=20=E8=A1=A5=E5=85=85=20v-for=20?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8F=92=E6=A7=BD=E5=90=8D=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/directive/v-slot/Foo-composition.uvue | 8 ++ pages/directive/v-slot/Foo-options.uvue | 8 ++ .../directive/v-slot/v-slot-composition.uvue | 83 ++++++++++++------- pages/directive/v-slot/v-slot-options.uvue | 32 ++++++- pages/directive/v-slot/v-slot.test.js | 14 +++- 5 files changed, 114 insertions(+), 31 deletions(-) diff --git a/pages/directive/v-slot/Foo-composition.uvue b/pages/directive/v-slot/Foo-composition.uvue index b562856..7766673 100644 --- a/pages/directive/v-slot/Foo-composition.uvue +++ b/pages/directive/v-slot/Foo-composition.uvue @@ -2,6 +2,10 @@ + + + + @@ -14,6 +18,10 @@ defineSlots<{ header(props : { msg : string }) : any, default(props : { num : number }) : any, + num1(props : { num : number }) : any, + num2(props : { num : number }) : any, + msgTrue(props : { msg : string }) : any, + msgFalse(props : { msg : string }) : any, footer(props : { arr : string[] }) : any }>() diff --git a/pages/directive/v-slot/Foo-options.uvue b/pages/directive/v-slot/Foo-options.uvue index e2ab869..0471f59 100644 --- a/pages/directive/v-slot/Foo-options.uvue +++ b/pages/directive/v-slot/Foo-options.uvue @@ -2,6 +2,10 @@ + + + + @@ -11,6 +15,10 @@ slots: Object as SlotsType<{ header: { msg: string } default: { num: number } + num1: { num: number } + num2: { num: number } + msgTrue: { msg: string } + msgFalse: { msg: string } footer: { arr: string[] } }>, data(){ diff --git a/pages/directive/v-slot/v-slot-composition.uvue b/pages/directive/v-slot/v-slot-composition.uvue index bdeffe3..ca1e7d5 100644 --- a/pages/directive/v-slot/v-slot-composition.uvue +++ b/pages/directive/v-slot/v-slot-composition.uvue @@ -1,28 +1,55 @@ - - - + + + \ No newline at end of file diff --git a/pages/directive/v-slot/v-slot-options.uvue b/pages/directive/v-slot/v-slot-options.uvue index 02a9e24..a2999cf 100644 --- a/pages/directive/v-slot/v-slot-options.uvue +++ b/pages/directive/v-slot/v-slot-options.uvue @@ -13,6 +13,24 @@ {{ num }} + + +