• Install Babel
 yarn add @vue/babel-plugin-jsx
Copy the code

Github.com/vuejs/jsx-n…

  • Configure the Babel. Config. Js
{
  "plugins": ["@vue/babel-plugin-jsx"]
}
Copy the code
  • Export JSX components
import { defineComponent, ref } from 'vue' export default defineComponent({ setup () { const n = ref('1') return () => { return ( <div> {n.value +  1} </div> ) } } })Copy the code