]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): handle template ref with number values (#8233)
author丶远方 <yangpanteng@gmail.com>
Fri, 5 May 2023 08:00:01 +0000 (16:00 +0800)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 08:00:01 +0000 (16:00 +0800)
close #8230

packages/runtime-core/src/vnode.ts

index bed2b4f1eeeb421cbad85735d61eee4994219e26..a69b34ed941cd0d07aa333deea3562995804e25c 100644 (file)
@@ -404,6 +404,9 @@ const normalizeRef = ({
   ref_key,
   ref_for
 }: VNodeProps): VNodeNormalizedRefAtom | null => {
+  if (typeof ref === 'number') {
+    ref = '' + ref
+  }
   return (
     ref != null
       ? isString(ref) || isRef(ref) || isFunction(ref)