rex 723cebac1a
[new feature] TabBar: improve performance & add new props & improve doc (#1722)
fix #1625

pull request 改动点:

- 重构组件,优化性能
- 新增 inactiveColor、name 属性
- 完善文档,增加小程序自定义tab-bar示例
2019-06-24 17:42:37 +08:00

19 lines
281 B
JavaScript

import Page from '../../common/page';
Page({
data: {
active: 0,
active2: 'home',
active3: 0
},
onShow() {
this.getTabBar().init();
},
onChange(event) {
const { key } = event.currentTarget.dataset;
this.setData({ [key]: event.detail });
}
});