Skip to content

Commit

Permalink
fix(compiler): only generate non-static ref for script setup if the b…
Browse files Browse the repository at this point in the history
…inding exists

fix #4431
  • Loading branch information
yyx990803 committed Sep 1, 2021
1 parent 168a17a commit 3628991
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/compiler-core/src/transforms/transformElement.ts
Expand Up @@ -465,7 +465,12 @@ export function buildProps(
// in inline mode there is no setupState object, so we can't use string
// keys to set the ref. Instead, we need to transform it to pass the
// acrtual ref instead.
if (!__BROWSER__ && context.inline) {
if (
!__BROWSER__ &&
value &&
context.inline &&
context.bindingMetadata[value.content]
) {
isStatic = false
}
}
Expand Down

0 comments on commit 3628991

Please sign in to comment.