mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[new feature] TabbarItem: add name prop
This commit is contained in:
@@ -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;
|
||||
});
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user