You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- This repo is only compatible with Babel 7.x, for 6.x please use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)
8
+
9
+
### Usage
10
+
11
+
Install the dependencies:
12
+
13
+
```sh
14
+
# for yarn:
15
+
yarn add @vue/babel-sugar-v-on
16
+
# for npm:
17
+
npm install @vue/babel-sugar-v-on --save
18
+
```
19
+
20
+
In your `.babelrc`:
21
+
22
+
```json
23
+
{
24
+
"plugins": ["@vue/babel-sugar-v-on"]
25
+
}
26
+
```
27
+
28
+
However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.
29
+
30
+
### Details
31
+
32
+
This plugin adds v-on to the JSX and tries to mirror the same behaviour as in vue-template-compiler, with a few differences:
33
+
34
+
1. You should use underscore (`_`) instead of dot (`.`) for modifiers (`vOn:click_prevent={this.test}`)
35
+
2. It is recommended to use camelCase version of it (`vOn`) in JSX, but you can use kebab-case too (`v-on`).
0 commit comments