Skip to content

Commit 35611df

Browse files
committed
chore: fix type
1 parent 4174055 commit 35611df

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

packages/runtime-vapor/src/apiCreateFor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export const createFor = (
396396
oldBlocks = []
397397
}
398398

399-
if (isMounted && frag.updated) frag.updated.forEach(m => m())
399+
if (isMounted && frag.$updated) frag.$updated.forEach(m => m())
400400
setActiveSub(prevSub)
401401
}
402402

packages/runtime-vapor/src/components/KeepAlive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
244244
return true
245245
},
246246
)
247-
;(frag.beforeMount || (frag.beforeMount = [])).push(() =>
247+
;(frag.$beforeMount || (frag.$beforeMount = [])).push(() =>
248248
cacheFragment(frag),
249249
)
250250
frag.getScope = key => {

packages/runtime-vapor/src/components/Teleport.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ export class TeleportFragment extends VaporFragment {
103103
// it will be called when root fragment changed
104104
if (this.parentComponent && this.parentComponent.ut) {
105105
if (isFragment(nodes)) {
106-
;(nodes.updated || (nodes.updated = [])).push(() => updateCssVars(this))
106+
;(nodes.$updated || (nodes.$updated = [])).push(() =>
107+
updateCssVars(this),
108+
)
107109
} else if (isArray(nodes)) {
108110
nodes.forEach(node => {
109111
if (isFragment(node)) {
110-
;(node.updated || (node.updated = [])).push(() =>
112+
;(node.$updated || (node.$updated = [])).push(() =>
111113
updateCssVars(this),
112114
)
113115
}

packages/runtime-vapor/src/fragment.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class VaporFragment<T extends Block = Block>
6060
) => void
6161

6262
// hooks
63-
updated?: ((nodes?: Block) => void)[]
63+
$updated?: ((nodes?: Block) => void)[]
6464

6565
constructor(nodes: T) {
6666
this.nodes = nodes
@@ -95,7 +95,7 @@ export class DynamicFragment extends VaporFragment {
9595
nodes: Block,
9696
scope: EffectScope,
9797
) => boolean)[]
98-
beforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[]
98+
$beforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[]
9999

100100
constructor(anchorLabel?: string) {
101101
super([])
@@ -215,8 +215,8 @@ export class DynamicFragment extends VaporFragment {
215215
this.$transition = applyTransitionHooks(this.nodes, transition)
216216
}
217217

218-
if (this.beforeMount) {
219-
this.beforeMount.forEach(hook =>
218+
if (this.$beforeMount) {
219+
this.$beforeMount.forEach(hook =>
220220
hook(this.current, this.nodes, this.scope!),
221221
)
222222
}
@@ -240,8 +240,8 @@ export class DynamicFragment extends VaporFragment {
240240
}
241241

242242
insert(this.nodes, parent, this.anchor)
243-
if (this.updated) {
244-
this.updated.forEach(hook => hook(this.nodes))
243+
if (this.$updated) {
244+
this.$updated.forEach(hook => hook(this.nodes))
245245
}
246246
}
247247
} else {

packages/runtime-vapor/src/vdomInterop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function createVDOMComponent(
402402
}
403403

404404
frag.nodes = vnode.el as any
405-
if (isMounted && frag.updated) frag.updated.forEach(m => m())
405+
if (isMounted && frag.$updated) frag.$updated.forEach(m => m())
406406
}
407407

408408
frag.remove = unmount
@@ -469,7 +469,7 @@ function renderVDOMSlot(
469469
}
470470
}
471471

472-
if (isMounted && frag.updated) frag.updated.forEach(m => m())
472+
if (isMounted && frag.$updated) frag.$updated.forEach(m => m())
473473
}
474474

475475
const render = (parentNode?: ParentNode, anchor?: Node | null) => {

0 commit comments

Comments
 (0)