将React组件转换为Vue组件
将React组件转换为Vue组件
JavaScript Vue.js相关
共54Star
详细介绍
react-to-vue
Install
yarn add @egoist/react-to-vue
Usage
import Vue from 'vue'
import React from 'react'
import toVue from '@egoist/react-to-vue'
const ReactComponent = () => {
const [count, setCount] = React.useState(0)
return <button onClick={() => setCount(count + 1)}>{count}</button>
}
const VueComponent = toVue(ReactComponent)
new Vue({
el: '#app',
render: h => h(VueComponent)
})
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
@egoist/react-to-vue © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily
-
110 Star
-
39 Star
-
2310 Star
-
6761 Star
-
536 Star
-
298 Star
-
157 Star
-
769 Star
-
22 Star