Skip to content

Commit ff60b93

Browse files
authored
fix(jsx-runtime): handle keys (#7976)
1 parent 0f73f39 commit ff60b93

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/vue/jsx-runtime/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const { h, Fragment } = require('vue')
22

3-
function jsx(type, { children, ...props }) {
3+
function jsx(type, props, key) {
4+
const { children } = props
5+
delete props.children
6+
if (arguments.length > 2) {
7+
props.key = key
8+
}
49
return h(type, props, children)
510
}
611

packages/vue/jsx-runtime/index.mjs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { h, Fragment } from 'vue'
22

3-
function jsx(type, { children, ...props }) {
3+
function jsx(type, props, key) {
4+
const { children } = props
5+
delete props.children
6+
if (arguments.length > 2) {
7+
props.key = key
8+
}
49
return h(type, props, children)
510
}
611

0 commit comments

Comments
 (0)