babel-plugin-jsx/README.md

41 lines
723 B
Markdown
Raw Normal View History

# Babel Plugin JSX for Vue 3.0
2020-05-13 19:14:28 +08:00
To add Vue JSX support.
2020-05-24 10:29:41 +08:00
## Installation
Install the plugin with:
2020-05-24 10:29:41 +08:00
```
2020-05-27 00:12:34 +08:00
npm install @ant-design-vue/babel-plugin-jsx -D
npm install @ant-design-vue/babel-helper-vue-transform-on
2020-05-24 10:29:41 +08:00
```
Then add the plugin to .babelrc:
2020-05-24 10:29:41 +08:00
```
{
2020-05-27 13:05:24 +08:00
"plugins": ["@ant-design-vue/babel-plugin-jsx", { "transformOn": true, "compatibleProps": true }]
2020-05-24 10:29:41 +08:00
}
```
2020-05-27 13:05:24 +08:00
## Usage
2020-05-13 19:14:28 +08:00
2020-05-27 13:05:24 +08:00
### options
2020-05-13 19:14:28 +08:00
2020-05-27 13:05:24 +08:00
* transformOn
2020-05-18 00:20:10 +08:00
2020-05-27 13:05:24 +08:00
transform `on: { click: xx }` to `onClick: xxx`, and you should install `@ant-design-vue/babel-helper-vue-transform-on`
2020-05-18 00:20:10 +08:00
2020-05-27 13:05:24 +08:00
* compatibleProps
2020-05-23 16:58:37 +08:00
2020-05-27 13:05:24 +08:00
compatible with Vue 2.x and you should install `@ant-design-vue/babel-helper-vue-compatible-props`
2020-05-23 16:58:37 +08:00
2020-05-18 00:20:10 +08:00
## Compatibility
This repo is only compatible with:
- **Babel 7+**
- **Vue 3+**