This repository was archived by the owner on Jul 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function createComponent(
2323 slots ,
2424 once ,
2525 )
26- setupComponent ( instance , singleRoot )
26+ setupComponent ( instance )
2727
2828 // register sub-component with current component for lifecycle management
2929 current . comps . add ( instance )
Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ export type Fragment = {
3030 [ fragmentKey ] : true
3131}
3232
33- export function setupComponent (
34- instance : ComponentInternalInstance ,
35- singleRoot : boolean = false ,
36- ) : void {
33+ export function setupComponent ( instance : ComponentInternalInstance ) : void {
3734 if ( __DEV__ ) {
3835 startMeasure ( instance , `init` )
3936 }
@@ -97,7 +94,7 @@ export function setupComponent(
9794 block = [ ]
9895 }
9996 instance . block = block
100- if ( singleRoot ) fallThroughAttrs ( instance )
97+ fallThroughAttrs ( instance )
10198 return block
10299 } )
103100 reset ( )
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ export function fallThroughAttrs(instance: ComponentInternalInstance): void {
7272 if ( inheritAttrs === false ) return
7373
7474 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 ) )
7682 }
7783}
You can’t perform that action at this time.
0 commit comments