JSX Syntactic Sugar Plugin for v-model
Switch branches/tags
Nothing to show
Clone or download
Latest commit d592db4 Aug 25, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Vue-compatible v-model (#3) Aug 17, 2017
test fix: change domPropsValue to value for components, fix #6 Aug 24, 2017
.gitignore Initial commit Jul 18, 2017
.travis.yml Wake up travis CI Jul 18, 2017
LICENSE Initial commit Jul 18, 2017
README.md Add example to README.md Jul 18, 2017
index.js fix: change domPropsValue to value for components, fix #6 Aug 24, 2017
package-lock.json 2.0.3 Aug 24, 2017
package.json 2.0.3 Aug 24, 2017

README.md

Build Status

JSX v-model for Vue JSX

This babel plugin adds some syntactic sugar to JSX.

Usage:

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.