fix(tabBarItem): issues:TabbarItem component in the route mode fails …#13177
Open
lzxiaoqi wants to merge 4 commits intoyouzan:mainfrom
Open
fix(tabBarItem): issues:TabbarItem component in the route mode fails …#13177lzxiaoqi wants to merge 4 commits intoyouzan:mainfrom
lzxiaoqi wants to merge 4 commits intoyouzan:mainfrom
Conversation
…to bind with v-model
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13177 +/- ##
==========================================
- Coverage 89.67% 89.61% -0.07%
==========================================
Files 257 257
Lines 7004 7008 +4
Branches 1732 1733 +1
==========================================
- Hits 6281 6280 -1
- Misses 378 384 +6
+ Partials 345 344 -1 ☔ View full report in Codecov by Sentry. |
Contributor
Author
Collaborator
|
Thanks for your PR. Can you add a test case for this issue? |
Contributor
Author
您好 测试用例已经添加 看是否ok的 |
inottn
reviewed
Nov 1, 2024
Comment on lines
62
to
68
| const pathMatched = | ||
| 'path' in config && | ||
| $route.matched.some((val) => config.path === val.path); | ||
| const nameMatched = | ||
| 'name' in config && | ||
| $route.matched.some((val) => config.name === val.name); | ||
| const isActive = pathMatched || nameMatched; |
Collaborator
There was a problem hiding this comment.
It should be achievable in a single iteration.
| $route.matched.some((val) => config.name === val.name); | ||
| const isActive = pathMatched || nameMatched; | ||
| if (isActive) { | ||
| parent.setActive(props.name ?? index.value, () => {}); |
Collaborator
There was a problem hiding this comment.
Computed getter functions should only perform pure computation and be free of side effects.
Contributor
Author
|
这个晚些时候想一下有没有更好的解决办法 看样子是优化代码解决计算属性中的副作用之后涉及到路由的单元测试存在点问题 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…to bind with v-model
Before submitting a pull request, please read the contributing guide.
在提交 pull request 之前,请阅读 贡献指南。
修复issues中提到的Tabbar组件在路由模式下访问TabbarItem导致v-model未同步修改的问题

TabbarItem component in the route mode fails to bind with v-model