@afeefa/vue-app 0.0.182 → 0.0.184
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.184
|
package/package.json
CHANGED
package/src/components/ATab.vue
CHANGED
package/src/components/ATabs.vue
CHANGED
@@ -8,6 +8,16 @@
|
|
8
8
|
:class="['label', {selected: index === currentIndex}]"
|
9
9
|
@click="setTab(index)"
|
10
10
|
>
|
11
|
+
<template v-if="icons[index]">
|
12
|
+
<a-icon
|
13
|
+
size="1.5rem"
|
14
|
+
:color="icons[index].color"
|
15
|
+
class="mt-n1 mr-1"
|
16
|
+
>
|
17
|
+
{{ icons[index].icon }}
|
18
|
+
</a-icon>
|
19
|
+
</template>
|
20
|
+
|
11
21
|
{{ title }}
|
12
22
|
</div>
|
13
23
|
</div>
|
@@ -27,17 +37,20 @@ import { Component, Vue } from '@a-vue'
|
|
27
37
|
})
|
28
38
|
export default class ATabs extends Vue {
|
29
39
|
titles = []
|
40
|
+
icons = []
|
30
41
|
currentIndex = 0
|
31
42
|
|
32
43
|
mounted () {
|
33
44
|
this.titles = this.$children.map(c => c.title)
|
45
|
+
this.icons = this.$children.map(c => c.icon)
|
34
46
|
|
35
47
|
this.$children[this.currentIndex].show()
|
36
48
|
}
|
37
49
|
|
38
50
|
setTab (index) {
|
39
51
|
this.currentIndex = index
|
40
|
-
this.$
|
52
|
+
const tabs = this.$slots.default.map(s => s.componentInstance)
|
53
|
+
tabs.forEach((tab, i) => {
|
41
54
|
if (i === this.currentIndex) {
|
42
55
|
tab.show()
|
43
56
|
} else {
|
@@ -64,7 +77,7 @@ export default class ATabs extends Vue {
|
|
64
77
|
justify-content: center;
|
65
78
|
|
66
79
|
.label {
|
67
|
-
padding: .
|
80
|
+
padding: .8rem 1.2rem .7rem;
|
68
81
|
background: white;
|
69
82
|
cursor: pointer;
|
70
83
|
|
@@ -80,7 +93,7 @@ export default class ATabs extends Vue {
|
|
80
93
|
}
|
81
94
|
|
82
95
|
&.selected {
|
83
|
-
background: #
|
96
|
+
background: #EEEEEE;
|
84
97
|
color: #666666;
|
85
98
|
}
|
86
99
|
}
|