From: Leonardo Piccioni de Almeida Date: Wed, 29 Mar 2023 08:17:34 +0000 (-0300) Subject: fix(jsx-runtime): handle keys (#7976) X-Git-Tag: v3.3.0-alpha.6~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff60b933ae4e02422393664ee7818cffadf9b58b;p=thirdparty%2Fvuejs%2Fcore.git fix(jsx-runtime): handle keys (#7976) --- diff --git a/packages/vue/jsx-runtime/index.js b/packages/vue/jsx-runtime/index.js index 255fb4490d..73b137d526 100644 --- a/packages/vue/jsx-runtime/index.js +++ b/packages/vue/jsx-runtime/index.js @@ -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) } diff --git a/packages/vue/jsx-runtime/index.mjs b/packages/vue/jsx-runtime/index.mjs index 92bb8a9d4a..57dd60af68 100644 --- a/packages/vue/jsx-runtime/index.mjs +++ b/packages/vue/jsx-runtime/index.mjs @@ -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) }