@@ -3,11 +3,9 @@ import {
3
3
insert ,
4
4
isFragment ,
5
5
isVaporComponent ,
6
- pauseTracking ,
7
6
proxyRefs ,
8
7
remove ,
9
8
renderEffect ,
10
- resetTracking ,
11
9
toRefs ,
12
10
useAttrs ,
13
11
VaporFragment ,
@@ -101,12 +99,12 @@ function resolveValue(current: Block, value: any, anchor?: Element) {
101
99
if ( anchor && anchor . parentNode ) {
102
100
remove ( current . nodes , anchor . parentNode )
103
101
insert ( node , anchor . parentNode , anchor )
104
- ; ( anchor as Element ) . remove ( )
102
+ anchor . parentNode . removeChild ( anchor )
105
103
}
106
104
} else if ( current instanceof Node ) {
107
105
if ( isFragment ( node ) && current . parentNode ) {
108
106
insert ( node , current . parentNode , current )
109
- ; ( current as Element ) . remove ( )
107
+ current . parentNode . removeChild ( current )
110
108
} else if ( node instanceof Node ) {
111
109
if ( current . nodeType === 3 && node . nodeType === 3 ) {
112
110
current . textContent = node . textContent
@@ -122,24 +120,23 @@ function resolveValue(current: Block, value: any, anchor?: Element) {
122
120
123
121
function resolveValues ( values : any [ ] = [ ] , _anchor ?: Element ) {
124
122
const nodes : Block [ ] = [ ]
123
+ const frag = createFragment ( nodes , _anchor )
125
124
const scopes : EffectScope [ ] = [ ]
126
125
for ( const [ index , value ] of values . entries ( ) ) {
127
126
const anchor = index === values . length - 1 ? _anchor : undefined
128
127
if ( typeof value === 'function' ) {
129
128
renderEffect ( ( ) => {
130
- pauseTracking ( )
131
129
if ( scopes [ index ] ) scopes [ index ] . stop ( )
132
130
scopes [ index ] = new EffectScope ( )
133
131
nodes [ index ] = scopes [ index ] . run ( ( ) =>
134
132
resolveValue ( nodes [ index ] , value ( ) , anchor ) ,
135
133
) !
136
- resetTracking ( )
137
134
} )
138
135
} else {
139
136
nodes [ index ] = resolveValue ( nodes [ index ] , value , anchor )
140
137
}
141
138
}
142
- return nodes
139
+ return frag
143
140
}
144
141
145
142
export function setNodes ( anchor : Element , ...values : any [ ] ) {
0 commit comments