Skip to content

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

Open
@chenyaohuan

Description

@chenyaohuan

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

Activity

chenyaohuan

chenyaohuan commented on Apr 16, 2025

@chenyaohuan
Author

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

self-assigned this
on Apr 17, 2025
LastLeaf

LastLeaf commented on Apr 17, 2025

@LastLeaf
Member

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

ComponentWithStore({
  data: {},
  storeBindings: // ...
})
added a commit that references this issue on Apr 17, 2025
chenyaohuan

chenyaohuan commented on Jul 1, 2025

@chenyaohuan
Author

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

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

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

LastLeaf

LastLeaf commented on Jul 2, 2025

@LastLeaf
Member

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

能给个有问题的 case 吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    storeBindings绑定数组之后,页面ts类型提示出错 · Issue #63 · wechat-miniprogram/mobx-miniprogram-bindings