轻量级Taro状态管理工具
npm i trox --save
import { createTrox, observer } from 'trox'
...
const model = createTarox({
name: 'test'
})
...
@observer
export default class Index extends Component {
...
handleOnClick = () => {
model.name = 'test2'
}
...
render() {
...
<View>{model.name}</View>
}
}