-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
fix(compiler-core): using v-once inside template with v-if error #7730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # packages/compiler-core/src/transforms/vIf.ts # packages/compiler-core/src/utils.ts
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Size ReportBundles
Usages
|
# Conflicts: # packages/compiler-core/src/transforms/vIf.ts # packages/compiler-core/src/utils.ts
const ret = (firstChild as ElementNode).codegenNode as | ||
| BlockCodegenNode | ||
| MemoExpression | ||
const vnodeCall = getMemoedVNodeCall(ret) | ||
const vnodeCall = getMemoedOrOnceVNodeCall(ret) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about the casting of ret
. Should that also include CacheExpression
?
I realise this would lead to type changes being needed elsewhere, but the incorrect casting may be hiding further bugs.
const { | ||
root, | ||
node: { codegenNode }, | ||
} = parseWithIfTransform( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parseWithIfTransform
does not contain transformOnce
inside, which makes the resulting snap look unreasonable, and does not contain v-once related code.
Let's pass transformOnce
to parseWithIfTransform
to make the snap more sense.
# Conflicts: # packages/compiler-core/src/utils.ts
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/runtime-core
@vue/reactivity
@vue/runtime-dom
@vue/shared
@vue/server-renderer
@vue/compat
vue
commit: |
close #7725