[new feature] TabbarItem: add name prop

This commit is contained in:
陈嘉涵
2019-05-19 18:20:54 +08:00
parent 20bf1f651e
commit a6b60c2a55
8 changed files with 160 additions and 8 deletions

View File

@@ -7,11 +7,14 @@ export default sfc({
mixins: [ParentMixin('vanTabbar')],
props: {
value: Number,
route: Boolean,
activeColor: String,
inactiveColor: String,
safeAreaInsetBottom: Boolean,
value: {
type: [String, Number],
default: 0
},
fixed: {
type: Boolean,
default: true
@@ -35,7 +38,7 @@ export default sfc({
methods: {
setActiveItem() {
this.children.forEach((item, index) => {
item.active = index === this.value;
item.active = (item.name || index) === this.value;
});
},