index.js
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(0, require("../common/component").VantComponent)({
relation: {
name: "tabbar-item",
type: "descendant",
current: "tabbar",
linked: function(e) {
e.parent = this, e.updateFromParent();
},
unlinked: function() {
this.updateChildren();
}
},
props: {
active: {
type: null,
observer: "updateChildren"
},
activeColor: {
type: String,
observer: "updateChildren"
},
inactiveColor: {
type: String,
observer: "updateChildren"
},
fixed: {
type: Boolean,
value: !0
},
border: {
type: Boolean,
value: !0
},
zIndex: {
type: Number,
value: 1
},
safeAreaInsetBottom: {
type: Boolean,
value: !0
}
},
methods: {
updateChildren: function() {
var e = this.children;
return Array.isArray(e) && e.length ? Promise.all(e.map(function(e) {
return e.updateFromParent();
})) : Promise.resolve();
},
onChange: function(e) {
var t = this.children.indexOf(e), n = e.data.name || t;
n !== this.data.active && this.$emit("change", n);
}
}
});