目录
import {
storeBindingsBehavior
} from 'mobx-miniprogram-bindings'
import {
store
} from '../../store/store'
behaviors: [storeBindingsBehavior],
storeBindings: {
//数据源
store,
fields: {
numA: 'numA',
numB: 'numB',
sum: 'sum'
},
actions: {
updateNum2: 'updateNum2'
}
{{numA}} + {{numB}} = {{sum}}
numB + 1
numB - 1
methods: {
btnHandler2(e) {
this.updateNum2(e.currentTarget.dataset.step)
}
}