# Babel Plugin JSX for Vue 3 [](https://www.npmjs.com/package/@vue/babel-plugin-jsx) [](https://github.com/actions-cool/issues-helper) To add Vue JSX support. English | [简体中文](/packages/babel-plugin-jsx/README-zh_CN.md) ## Installation Install the plugin with: ```bash npm install @vue/babel-plugin-jsx -D ``` Then add the plugin to your babel config: ```json { "plugins": ["@vue/babel-plugin-jsx"] } ``` ## Usage ### options #### transformOn Type: `boolean` Default: `false` transform `on: { click: xx }` to `onClick: xxx` #### optimize Type: `boolean` Default: `false` When enabled, this plugin generates optimized runtime code using [`PatchFlags`](https://vuejs.org/guide/extras/rendering-mechanism#patch-flags) and [`SlotFlags`](https://github.com/vuejs/core/blob/v3.5.13/packages/runtime-core/src/componentSlots.ts#L69-L77) to improve rendering performance. However, due to JSX's dynamic nature, the optimizations are not as comprehensive as those in Vue's official template compiler. Since the optimized code may skip certain re-renders to improve performance, we strongly recommend thorough testing of your application after enabling this option to ensure everything works as expected. #### isCustomElement Type: `(tag: string) => boolean` Default: `undefined` configuring custom elements #### mergeProps Type: `boolean` Default: `true` merge static and dynamic class / style attributes / onXXX handlers #### enableObjectSlots Type: `boolean` Default: `true` Whether to enable `object slots` (mentioned below the document) syntax". It might be useful in JSX, but it will add a lot of `_isSlot` condition expressions which increase your bundle size. And `v-slots` is still available even if `enableObjectSlots` is turned off. #### pragma Type: `string` Default: `createVNode` Replace the function used when compiling JSX expressions. #### resolveType Type: `boolean` Default: `false` (**Experimental**) Infer component metadata from types (e.g. `props`, `emits`, `name`). This is an experimental feature and may not work in all cases. ## Syntax ### Content functional component ```jsx const App = () =>
Ant Design Vue |
![]() Vant |
![]() Element Plus |
Vue Json Pretty |