react-vue.js
A fork of Vue, only modifies very litter code, extracts its reactivity core, and adds an observer function.
Install
npm install --save react-vue
Usage
;; const store = { return count: 0 } methods: { thiscount ++; } ; @observer { return <h1 onClick=storeincrease>storecount</h1>; }
As shown above, the data changes, the view updates. Most of your vue magic is still available in react, even if Vuex.
API
Almost all api points to the vue's official document. If you are familiar with vue, there is no unknown usage.
Global
Options
Instance
observer
Inspiration from mobx, used to convert React components into reactive components.
@observer
(decorator) is optional, observer(class Timer ... { })
achieves exactly the same.
Single File Components
Since react-vue only contains vue's reactivity system, there is no lifecycle, no template. For the full support of SFC, try react-vue-loader.