vue2react
Transform Vue component to React component.
Now support tranform SFC (.vue) file.
There are 2 ways to use the transform tool: web page or cli.
CLI
Install
or
Usage
bash example
vtr help infomation
Support
- Data
- [x] data
- [x] props
- [x] propsData
- [x] computed
- [x] methods
- [ ] watch
- DOM
- [ ] el
- [x] template
- [ ] render
- [ ] renderError
- Lifecycle Hooks
- [x] created
- [x] mounted
- [x] updated
- [x] beforeDestroy
- [x] errorCaptured
- Directives
- [ ] v-text
- [x] v-html
- [x] v-show
- [x] v-if
- [ ] v-else
- [ ] v-else-if
- [x] v-for
- [x] v-on / @
- [x] v-bind / :
- [ ] v-model
- [ ] v-pre
- [ ] v-cloak
- [ ] v-once
- Special Attributes
- [x] key
- [ ] ref
Example
Demo1
Vue Code | React Code |
![]() |
![]() |
Demo2
Vue Code | React Code |
![]() |
![]() |