babel-plugin-jsx-v-model

JSX v-model transform

MIT 5 个版本
安装
npm install babel-plugin-jsx-v-model
yarn add babel-plugin-jsx-v-model
pnpm add babel-plugin-jsx-v-model
bun add babel-plugin-jsx-v-model
README

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.

版本列表
2.0.3 2017-08-24
2.0.2 2017-08-24
2.0.1 2017-08-18
2.0.0 2017-08-17
1.0.0 2017-07-18