@afeefa/vue-app 0.0.182 → 0.0.184

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.0.182
1
+ 0.0.184
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.182",
3
+ "version": "0.0.184",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  import { Component, Vue } from '@a-vue'
9
9
 
10
10
  @Component({
11
- props: ['title']
11
+ props: ['title', 'icon']
12
12
  })
13
13
  export default class ATab extends Vue {
14
14
  visible = false
@@ -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.$children.forEach((tab, i) => {
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: .5rem 1rem .7rem;
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: #DDDDDD;
96
+ background: #EEEEEE;
84
97
  color: #666666;
85
98
  }
86
99
  }
@@ -20,7 +20,7 @@
20
20
  v-text="icon.icon"
21
21
  />
22
22
 
23
- <div class="titleContainer ml-n2">
23
+ <div class="titleContainer ml-n1">
24
24
  <h3 v-if="subtitle">
25
25
  {{ subtitle }}
26
26
  </h3>