Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lzxiaoqi
Copy link
Contributor

…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
bug

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.61%. Comparing base (379f44a) to head (a2f9cdf).

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.
📢 Have feedback on the report? Share it here.

@lzxiaoqi
Copy link
Contributor Author

#13172

@inottn
Copy link
Collaborator

inottn commented Oct 30, 2024

Thanks for your PR. Can you add a test case for this issue?

@lzxiaoqi
Copy link
Contributor Author

lzxiaoqi commented Oct 30, 2024

Thanks for your PR. Can you add a test case for this issue?感谢您的 Pull Request。能否为这个问题添加一个测试用例?

您好 测试用例已经添加 看是否ok的

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;
Copy link
Collaborator

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, () => {});
Copy link
Collaborator

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.

@lzxiaoqi
Copy link
Contributor Author

lzxiaoqi commented Nov 2, 2024

这个晚些时候想一下有没有更好的解决办法 看样子是优化代码解决计算属性中的副作用之后涉及到路由的单元测试存在点问题

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

Successfully merging this pull request may close these issues.

3 participants