File tree Expand file tree Collapse file tree 1 file changed +41
-13
lines changed Expand file tree Collapse file tree 1 file changed +41
-13
lines changed Original file line number Diff line number Diff line change 4
4
defineComponent ,
5
5
Fragment ,
6
6
h as vueH ,
7
+ isRef ,
7
8
Ref ,
8
9
VNode ,
9
10
} from "vue" ;
@@ -76,19 +77,46 @@ export const renderCaseSplitted = defineComponent<{
76
77
outProps [ eventName ] = eventValue ;
77
78
}
78
79
80
+ let manualTrigger : ( ) => void ;
81
+ const manualTriggerRef = customRef ( ( track , trigger ) => {
82
+ manualTrigger = trigger ;
83
+ return {
84
+ get : ( ) => track ( ) ,
85
+ set : ( ) => undefined ,
86
+ } ;
87
+ } ) ;
88
+
89
+ for ( const slotSignal of Object . values ( slots ) ) {
90
+ createEffect ( ( ) => {
91
+ slotSignal ( ) ;
92
+ manualTrigger ( ) ;
93
+ } ) ;
94
+ }
95
+
79
96
return ( ) =>
80
- vueH ( Fragment , null , [
81
- inputs ,
82
- vueH (
83
- component ,
84
- outProps ,
85
- Object . fromEntries (
86
- Object . entries ( slots ) . map ( ( [ slotName , slotSignal ] ) => [
87
- slotName ,
88
- ( ) => slotSignal ( ) ,
89
- ] )
90
- )
91
- ) ,
92
- ] ) ;
97
+ vueH (
98
+ Fragment ,
99
+ {
100
+ manualTrigger : manualTriggerRef . value ,
101
+ } ,
102
+ [
103
+ inputs ,
104
+ vueH (
105
+ component ,
106
+ Object . fromEntries (
107
+ Object . entries ( outProps ) . map ( ( [ propName , propRef ] ) => [
108
+ propName ,
109
+ isRef ( propRef ) ? propRef . value : propRef ,
110
+ ] )
111
+ ) ,
112
+ Object . fromEntries (
113
+ Object . entries ( slots ) . map ( ( [ slotName , slotSignal ] ) => [
114
+ slotName ,
115
+ ( ) => slotSignal ( ) ,
116
+ ] )
117
+ )
118
+ ) ,
119
+ ]
120
+ ) ;
93
121
} ,
94
122
} ) ;
You can’t perform that action at this time.
0 commit comments