-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
fix(tabBarItem): issues:TabbarItem component in the route mode fails … #13177
base: main
Are you sure you want to change the base?
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. |
Thanks for your PR. Can you add a test case for this issue? |
您好 测试用例已经添加 看是否ok的 |
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; |
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.
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, () => {}); |
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.
Computed getter functions should only perform pure computation and be free of side effects.
这个晚些时候想一下有没有更好的解决办法 看样子是优化代码解决计算属性中的副作用之后涉及到路由的单元测试存在点问题 |
…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