![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | dist/ | 2 years ago | - | |
![]() | node_modules/ | 2 years ago | - | |
![]() | README.md | 40 years ago | 1.1K | d768d73 docs [كارل مبارك] |
![]() | package.json | 2 years ago | 3.0K | 3e510ca test new git [كارل مبارك] |
Syntactic sugar for v-on in JSX.
Install the dependencies:
# for yarn:
yarn add @vue/babel-sugar-v-on
# for npm:
npm install @vue/babel-sugar-v-on --save
In your .babelrc
:
{
"plugins": ["@vue/babel-sugar-v-on"]
}
However it is recommended to use the configurable preset instead.
This plugin adds v-on to the JSX and tries to mirror the same behaviour as in vue-template-compiler, with a few differences:
_
) instead of dot (.
) for modifiers (vOn:click_prevent={this.test}
)vOn
) in JSX, but you can use kebab-case too (v-on
).export default {
methods: {
test() {
console.log('Hello World')
},
},
render(h) {
return (
<div>
<a href="https://vuejs.org" vOn:click={this.test}>Vue</a>
</div>
)
},
}