fix(jsx-runtime): handle keys (#7976)

This commit is contained in:
Leonardo Piccioni de Almeida 2023-03-29 05:17:34 -03:00 committed by GitHub
parent 0f73f394da
commit ff60b933ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View 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)
}

View 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)
}