目录
import {
createStoreBindings
} from 'mobx-miniprogram-bindings'
import {
store
} from '../../store/store'
this.storeBindings = createStoreBindings(this, {
store,
fields: ['numA', 'numB', 'sum'],
actions: ['updateNum1']
})
onUnload: function () {
this.storeBindings.destroyStoreBindings()
},
{{numA}} + {{numB}} = {{sum}}
numA + 1
numA - 1
btnHandler1(e) {
this.updateNum1(e.currentTarget.dataset.step)
}
