mobx-miniprogram-bindings
mobx-miniprogram-bindings copied to clipboard
storeBindings绑定数组之后,页面ts类型提示出错
我的页面storeBindings绑定单个store的时候页面ts类型提示都是正常的,现在的业务场景需要绑定多个store,把storeBindings改成了用数组的方法绑定,但是页面store相关的ts都飘红了。
多个store绑定:
单个store绑定:
要写一个 data: {} ,要不然无法推断。例如:
ComponentWithStore({
data: {},
storeBindings: // ...
})
要写一个
data: {},要不然无法推断。例如:ComponentWithStore({ data: {}, storeBindings: // ... })
页面本来就有自己的data,写了之后还是会报错的
上面我加了个测试用例看起来没问题。
能给个有问题的 case 吗?