babel-plugin-jsx-v-model

2.0.3 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.3
    74,122
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.3
    74,122
  • 2.0.2
    0
  • 2.0.1
    0
  • 2.0.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i babel-plugin-jsx-v-model

Weekly Downloads

74,122

Version

2.0.3

License

MIT

Last publish

Collaborators

  • nickmessing