]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(jsx-runtime): handle keys (#7976)
authorLeonardo Piccioni de Almeida <leopiccionia@gmail.com>
Wed, 29 Mar 2023 08:17:34 +0000 (05:17 -0300)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2023 08:17:34 +0000 (16:17 +0800)
packages/vue/jsx-runtime/index.js
packages/vue/jsx-runtime/index.mjs

index 255fb4490dfd19c4e18eb6371603ea28943f9238..73b137d5261dc6f2afda006d78efe87e2cfd8b7b 100644 (file)
@@ -1,6 +1,11 @@
 const { h, Fragment } = require('vue')
 
-function jsx(type, { children, ...props }) {
+function jsx(type, props, key) {
+  const { children } = props
+  delete props.children
+  if (arguments.length > 2) {
+    props.key = key
+  }
   return h(type, props, children)
 }
 
index 92bb8a9d4ade3c943a3cbec15f3d97ddc4097112..57dd60af68f12e5924bb78103a1a79db6304c991 100644 (file)
@@ -1,6 +1,11 @@
 import { h, Fragment } from 'vue'
 
-function jsx(type, { children, ...props }) {
+function jsx(type, props, key) {
+  const { children } = props
+  delete props.children
+  if (arguments.length > 2) {
+    props.key = key
+  }
   return h(type, props, children)
 }