zydx-plus 1.15.58 → 1.15.59

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.15.58",
3
+ "version": "1.15.59",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="tabs cl">
3
- <div class="tabs-li" :class="{'tab-active': active === index}" @click="listTap(index)" v-for="(item,index) in list" :key="index">{{ item[column[0]] }}</div>
3
+ <div class="tabs-li" :class="{'tab-active': actives === index}" @click="listTap(index)" v-for="(item,index) in list" :key="index">{{ item[column[0]] }}</div>
4
4
  <div v-if="addShow" @click="addTap" class="tabs-li tab-add">+</div>
5
5
  </div>
6
6
  </template>
@@ -10,10 +10,18 @@ export default {
10
10
  name: "zydx-tab",
11
11
  data() {
12
12
  return {
13
- active: 0
13
+ actives: 0
14
14
  }
15
15
  },
16
16
  props: {
17
+ active: {
18
+ type: String,
19
+ default: ''
20
+ },
21
+ activeId: {
22
+ type: String,
23
+ default: ''
24
+ },
17
25
  addShow: {
18
26
  type: Boolean,
19
27
  default: false
@@ -27,16 +35,27 @@ export default {
27
35
  default: () => ['name']
28
36
  },
29
37
  },
30
- methods: {
38
+ mounted() {
39
+ if (this.activeId) {
40
+ this.list.forEach((item, index) => {
41
+ if (item[this.activeId] === this.active) {
42
+ this.actives = index
43
+ }
44
+ })
45
+ } else {
46
+ this.actives = 0
47
+ }
48
+ },
49
+ methods: {
31
50
  listTap(index) {
32
- this.active = index
51
+ this.actives = index
33
52
  this.$emit('confirm', {
34
53
  data: this.list[index],
35
54
  index: index
36
55
  })
37
56
  },
38
57
  addTap() {
39
- this.$emit('addTab')
58
+ this.$emit('addTap')
40
59
  }
41
60
  }
42
61
  }
package/src/index.js CHANGED
@@ -49,7 +49,7 @@ function install(app) {
49
49
  }
50
50
 
51
51
  export default {
52
- version: '1.15.58',
52
+ version: '1.15.59',
53
53
  install,
54
54
  Calendar,
55
55
  Message,