fix(jsx-runtime): fix automatic runtime implementation (#7959)

This commit is contained in:
Remco Haszing 2023-03-28 05:06:49 +02:00 committed by GitHub
parent bcf5841dde
commit 5838950ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 5 deletions

View File

@ -1,4 +1,10 @@
const Vue = require('vue')
exports.jsx = Vue.h
exports.jsxDEV = Vue.h
exports.Fragment = Vue.Fragment
const { h, Fragment } = require('vue')
function jsx(type, { children, ...props }) {
return h(type, props, children)
}
exports.jsx = jsx
exports.jsxs = jsx
exports.jsxDEV = jsx
exports.Fragment = Fragment

View File

@ -1 +1,12 @@
export { h as jsx, h as jsxDEV, Fragment } from 'vue'
import { h, Fragment } from 'vue'
function jsx(type, { children, ...props }) {
return h(type, props, children)
}
export {
Fragment,
jsx,
jsx as jsxs,
jsx as jsxDEV
}

View File

@ -43,6 +43,11 @@
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx-dev-runtime": {
"types": "./jsx-runtime/index.d.ts",
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx": {
"types": "./jsx.d.ts"
},