feat: v-once
Note: only compiler transform is tested - integration with runtime still needs to be tested.
This commit is contained in:
@@ -177,10 +177,15 @@ export function createRenderer<
|
||||
optimized: boolean = false
|
||||
) {
|
||||
// patching & not same type, unmount old tree
|
||||
if (n1 != null && !isSameType(n1, n2)) {
|
||||
anchor = getNextHostNode(n1)
|
||||
unmount(n1, parentComponent, parentSuspense, true)
|
||||
n1 = null
|
||||
if (n1 != null) {
|
||||
if (!isSameType(n1, n2)) {
|
||||
anchor = getNextHostNode(n1)
|
||||
unmount(n1, parentComponent, parentSuspense, true)
|
||||
n1 = null
|
||||
} else if (n1.props && n1.props.$once) {
|
||||
console.log(111)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const { type, shapeFlag } = n2
|
||||
|
||||
Reference in New Issue
Block a user