Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

希望 wxc-tab-bar 组件的 setPage 方法新增一个小功能来设置默认高亮 currentPage #292

Closed
AppianZ opened this issue Jun 15, 2018 · 5 comments

Comments

@AppianZ
Copy link

AppianZ commented Jun 15, 2018

wxc-tab-bar 源码中的第204行

 if (!this.isTabView) {
    this.jumpOut(url);
     return;
 }
 if (!this.isTabView) {
    this.currentPage = page; // 新增
    this._animateTransformX(page, animated); // 新增
    this.$emit('wxcTabBarCurrentTabSelected', { page }); // 新增
    this.jumpOut(url);
    return;
 }

这么做的目的是因为没有办法直接设置 tab 默认高亮的 currentPage,
所以希望,isTabView 为 false 的情况下也能通过 setPage 这个语义化的函数来设置默认高亮的 currentPage。

当然了,能直接设置 currentPage 作为 prop 传入组件肯定更好 :-)

@tw93
Copy link
Member

tw93 commented Jun 22, 2018

下个版本加上

@AppianZ
Copy link
Author

AppianZ commented Jun 26, 2018

我可以给你们提个pr

@tw93
Copy link
Member

tw93 commented Jun 29, 2018

欢迎@AppianZ

@tw93
Copy link
Member

tw93 commented Jul 29, 2018

最新版本已经更新,请升级到最新!

@tw93 tw93 closed this as completed Jul 29, 2018
@AppianZ
Copy link
Author

AppianZ commented Jul 30, 2018

棒棒!

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

No branches or pull requests

2 participants