@@ -3,11 +3,9 @@ import {
33 insert ,
44 isFragment ,
55 isVaporComponent ,
6- pauseTracking ,
76 proxyRefs ,
87 remove ,
98 renderEffect ,
10- resetTracking ,
119 toRefs ,
1210 useAttrs ,
1311 VaporFragment ,
@@ -101,12 +99,12 @@ function resolveValue(current: Block, value: any, anchor?: Element) {
10199 if ( anchor && anchor . parentNode ) {
102100 remove ( current . nodes , anchor . parentNode )
103101 insert ( node , anchor . parentNode , anchor )
104- ; ( anchor as Element ) . remove ( )
102+ anchor . parentNode . removeChild ( anchor )
105103 }
106104 } else if ( current instanceof Node ) {
107105 if ( isFragment ( node ) && current . parentNode ) {
108106 insert ( node , current . parentNode , current )
109- ; ( current as Element ) . remove ( )
107+ current . parentNode . removeChild ( current )
110108 } else if ( node instanceof Node ) {
111109 if ( current . nodeType === 3 && node . nodeType === 3 ) {
112110 current . textContent = node . textContent
@@ -122,24 +120,23 @@ function resolveValue(current: Block, value: any, anchor?: Element) {
122120
123121function resolveValues ( values : any [ ] = [ ] , _anchor ?: Element ) {
124122 const nodes : Block [ ] = [ ]
123+ const frag = createFragment ( nodes , _anchor )
125124 const scopes : EffectScope [ ] = [ ]
126125 for ( const [ index , value ] of values . entries ( ) ) {
127126 const anchor = index === values . length - 1 ? _anchor : undefined
128127 if ( typeof value === 'function' ) {
129128 renderEffect ( ( ) => {
130- pauseTracking ( )
131129 if ( scopes [ index ] ) scopes [ index ] . stop ( )
132130 scopes [ index ] = new EffectScope ( )
133131 nodes [ index ] = scopes [ index ] . run ( ( ) =>
134132 resolveValue ( nodes [ index ] , value ( ) , anchor ) ,
135133 ) !
136- resetTracking ( )
137134 } )
138135 } else {
139136 nodes [ index ] = resolveValue ( nodes [ index ] , value , anchor )
140137 }
141138 }
142- return nodes
139+ return frag
143140}
144141
145142export function setNodes ( anchor : Element , ...values : any [ ] ) {
0 commit comments