-
Notifications
You must be signed in to change notification settings - Fork 477
fix: 优化全局状态处理和资源加载逻辑 #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: 优化全局状态处理和资源加载逻辑 #1207
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 原代码中,直接赋值为 store(),出码后,变量的值变成了 store 实例,而不是所需的变量值 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ const useStores = () => { | |
| const stores = {} | ||
|
|
||
| Object.values({ ...useDefinedStores }).forEach((store) => { | ||
| stores[store.$id] = store() | ||
| stores[store.$id] = store().$state | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 请问这里改成 这里应该不仅仅只赋值 store 的 state。
|
||
| }) | ||
|
|
||
| return stores | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
【bug 场景】:


当全局应用状态设置为数组时,绑定变量弹窗处分割的状态不正确。
【origin 状态分割的场景】
应用的状态可能有很多的字段,为了方便用户快速绑定对应的字段,这里做了优化。
比如一个应用状态可能是 object,有很多的字段,可能还有 getter:
所以这里仅特殊处理一下数组的场景会好一点?