File tree 3 files changed +10
-7
lines changed
packages/runtime-vapor/src
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function createComponent(
23
23
slots ,
24
24
once ,
25
25
)
26
- setupComponent ( instance , singleRoot )
26
+ setupComponent ( instance )
27
27
28
28
// register sub-component with current component for lifecycle management
29
29
current . comps . add ( instance )
Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ export type Fragment = {
30
30
[ fragmentKey ] : true
31
31
}
32
32
33
- export function setupComponent (
34
- instance : ComponentInternalInstance ,
35
- singleRoot : boolean = false ,
36
- ) : void {
33
+ export function setupComponent ( instance : ComponentInternalInstance ) : void {
37
34
if ( __DEV__ ) {
38
35
startMeasure ( instance , `init` )
39
36
}
@@ -97,7 +94,7 @@ export function setupComponent(
97
94
block = [ ]
98
95
}
99
96
instance . block = block
100
- if ( singleRoot ) fallThroughAttrs ( instance )
97
+ fallThroughAttrs ( instance )
101
98
return block
102
99
} )
103
100
reset ( )
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ export function fallThroughAttrs(instance: ComponentInternalInstance): void {
72
72
if ( inheritAttrs === false ) return
73
73
74
74
if ( block instanceof Element ) {
75
- renderEffect ( ( ) => setDynamicProps ( block , instance . attrs ) )
75
+ // attrs in static template
76
+ const initial : Record < string , string > = { }
77
+ for ( let i = 0 ; i < block . attributes . length ; i ++ ) {
78
+ const attr = block . attributes [ i ]
79
+ initial [ attr . name ] = attr . value
80
+ }
81
+ renderEffect ( ( ) => setDynamicProps ( block , instance . attrs , initial ) )
76
82
}
77
83
}
You can’t perform that action at this time.
0 commit comments