File tree Expand file tree Collapse file tree 2 files changed +40
-5
lines changed
Expand file tree Collapse file tree 2 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -110,20 +110,21 @@ export default defineAppConfig({
110110 } ,
111111 } ,
112112 ul : {
113- initial : { x : 100 , opacity : 0 } ,
114- visibleOnce : { x : 0 , opacity : 1 } ,
113+ initial : { x : 100 , y : 100 , opacity : 0 } ,
114+ visibleOnce : { x : 0 , y : 0 , opacity : 1 } ,
115115 } ,
116116 li : {
117- initial : { x : 100 , opacity : 0 } ,
117+ initial : { x : 40 , y : 20 , opacity : 0 } ,
118118 hovered : {
119119 x : 10 ,
120120 opacity : 1 ,
121- transition : { mass : 0.5 , damping : 5 , delay : 0 } ,
121+ transition : { mass : 1 , delay : 0 } ,
122122 } ,
123123 visibleOnce : {
124124 x : 0 ,
125+ y : 0 ,
125126 opacity : 1 ,
126- transition : { mass : 0.5 , damping : 5 } ,
127+ transition : { mass : 1 } ,
127128 } ,
128129 } ,
129130 headers : {
Original file line number Diff line number Diff line change 1+ export default defineComponent ( {
2+ setup ( ) {
3+ const MotionComponent = resolveComponent ( 'Motion' )
4+ const slots = useSlots ( )
5+ const appConfig = useAppConfig ( )
6+
7+ return ( ) => {
8+ const nodes : VNode [ ] = slots . default ?.( ) || [ ]
9+
10+ return h (
11+ 'ol' ,
12+ {
13+ ...appConfig . motions . ul ,
14+ } ,
15+ nodes . map ( ( node , i ) => {
16+ node . props = {
17+ is : 'li' ,
18+ ...appConfig . motions . li ,
19+ visibleOnce : {
20+ ...appConfig . motions . li . visibleOnce ,
21+ transition : {
22+ ...appConfig . motions . li . visibleOnce . transition ,
23+ delay : i * 50 ,
24+ } ,
25+ } ,
26+ }
27+
28+ // @ts -expect-error type conflict but seems to work fine
29+ return h ( MotionComponent , { ...node . props } , node . children )
30+ } ) ,
31+ )
32+ }
33+ } ,
34+ } )
You can’t perform that action at this time.
0 commit comments