babel-plugin-transform-react-to-vue
🚧 In development...
Install
yarn add babel-plugin-transform-react-to-vue --dev
Usage
{
"plugins": ["transform-react-to-vue"]
}
Input:
class Counter extends Component {
state = { count: 0 }
inc = () => this.setState({count: this.state.count + 1})
render() {
return <button onClick={this.inc}>
{this.state.count}
</button>
}
}
Output:
var Counter = {
data() {
return {
count: 0
}
},
methods: {
inc() {
this.count = this.count + 1
}
},
render() {
return <button onClick={this.inc}>
{this.count}
</button>
}
}
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
babel-plugin-transform-react-to-vue © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin