mobx-miniprogram-bindings icon indicating copy to clipboard operation
mobx-miniprogram-bindings copied to clipboard

storeBindings绑定数组之后,页面ts类型提示出错

Open chenyaohuan opened this issue 8 months ago • 4 comments

我的页面storeBindings绑定单个store的时候页面ts类型提示都是正常的,现在的业务场景需要绑定多个store,把storeBindings改成了用数组的方法绑定,但是页面store相关的ts都飘红了。

chenyaohuan avatar Apr 16 '25 03:04 chenyaohuan

多个store绑定:Image 单个store绑定:Image

chenyaohuan avatar Apr 16 '25 03:04 chenyaohuan

要写一个 data: {} ,要不然无法推断。例如:

ComponentWithStore({
  data: {},
  storeBindings: // ...
})

LastLeaf avatar Apr 17 '25 07:04 LastLeaf

要写一个 data: {} ,要不然无法推断。例如:

ComponentWithStore({ data: {}, storeBindings: // ... })

页面本来就有自己的data,写了之后还是会报错的

chenyaohuan avatar Jul 01 '25 12:07 chenyaohuan

上面我加了个测试用例看起来没问题。

能给个有问题的 case 吗?

LastLeaf avatar Jul 02 '25 08:07 LastLeaf