mirror of https://github.com/vuejs/core.git
fix(jsx-runtime): handle keys (#7976)
This commit is contained in:
parent
0f73f394da
commit
ff60b933ae
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue