|
|
3 anos atrás | |
|---|---|---|
| .. | ||
| .vscode | 3 anos atrás | |
| test | 3 anos atrás | |
| .npmignore | 3 anos atrás | |
| .travis.yml | 3 anos atrás | |
| LICENSE | 3 anos atrás | |
| README.md | 3 anos atrás | |
| index.js | 3 anos atrás | |
| package.json | 3 anos atrás | |
This babel plugin adds some syntactic sugar to JSX.
npm i babel-plugin-jsx-v-model -D
Then add jsx-v-model to your .babelrc file under plugins
example .babelrc:
{
"presets": ["es2015"],
"plugins": ["jsx-v-model", "transform-vue-jsx"]
}
code:
Vue.component('hello-world', {
data: () => ({
text: 'Hello World!'
}),
render () {
return (
<div>
<input type="text" v-model={this.text} />
{this.text}
</div>
)
}
})
Behaviour is similar to vue template's v-model.