-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor(store): 使用pinia重构仓库 #134
refactor(store): 使用pinia重构仓库 #134
Conversation
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.
这么写是吧?我以为你会给每个业务模块拆出来作为一个 store,你现在还是分的 service 和 system。先这样吧
其实两种都可以,我觉得全拆开会好一点,那就拆开写吧,套一层有种脱裤子放屁的感觉 |
src/store/index.ts
Outdated
useSystemStore, | ||
useServiceStore |
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.
这两个函数在这了,为什么还要给他套一个 useMainStore?
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.
主要是想把所有仓库整合到一起,之前是这么开发的,有点繁琐了,我之后把这一层去掉
先按你这样写吧,这样改动成本小,风险小。后面碰到具体业务的时候,再把这个业务对应的模块拆出来。 如果一次性拆完的话,所有用户在整个 app 范围内都要丢一次缓存。后面慢慢拆的话,业务模块更新了,一个模块丢缓存用户反馈应该不会太强。 你这次这样拆成两块也会丢缓存,但是粒度比较粗,方便给原来的缓存迁移过来。从 vuex 这个 key 下面拿到缓存,然后把 service 和 system 两个大对象拿出来,写到新的缓存项,然后给 vuex 这条缓存记录删掉。这部分逻辑在 app.use() 之前执行。你看这个缓存移植方案行不? |
我觉得没问题 |
package.json
Outdated
"babel-preset-taro": "3.6.8", | ||
"css-loader": "3.4.2", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^9.12.0", | ||
"eslint-import-resolver-typescript": "^3.6.3", | ||
"eslint-plugin-import": "^2.31.0", | ||
"eslint-plugin-vue": "^9.28.0", | ||
"eslint-plugin-vue": "^9.29.0", |
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.
给这个更新了干啥?
你快点合进来吧,小步快走,别问题都累计在一个 pr 上 |
0800799
to
d97375c
Compare
CI报错是lint问题,用store.commit的地方太多了,要不先把这个pr合掉 |
这不是 lint 问题啊,你把 早知道你这问题了,直接合吧,后面解决 |
b11574b
to
1487388
Compare
#113