index.js
1.64 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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const component_1 = require("../common/component");
const relation_1 = require("../common/relation");
const link_1 = require("../mixins/link");
(0, component_1.VantComponent)({
relation: (0, relation_1.useParent)("grid"),
classes: [ "content-class", "icon-class", "text-class" ],
mixins: [ link_1.link ],
props: {
icon: String,
iconColor: String,
iconPrefix: {
type: String,
value: "van-icon",
},
dot: Boolean,
info: null,
badge: null,
text: String,
useSlot: Boolean,
},
data: {
viewStyle: "",
},
mounted () {
this.updateStyle();
},
methods: {
updateStyle () {
if (!this.parent) {
return;
}
const _a = this.parent; const data = _a.data; const children = _a.children;
const border = data.border; const center = data.center; const clickable = data.clickable; const columnNum = data.columnNum; const direction = data.direction; const gutter = data.gutter; const iconSize = data.iconSize; const reverse = data.reverse; const square = data.square;
this.setData({
center,
border,
square,
gutter,
clickable,
direction,
reverse,
iconSize,
index: children.indexOf(this),
columnNum,
});
},
onClick () {
this.$emit("click");
this.jumpLink();
},
},
});