gyyg-components 0.2.21 → 0.2.22

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": "gyyg-components",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -1,24 +1,62 @@
1
1
  <template>
2
2
  <div class="btn-group">
3
- <div v-for="btn in btnList" :key="btn.id"
4
- v-has-permi="btn.hasPermi ? [btn.hasPermi] : undefined">
5
- <el-button
6
- v-if="!btn['componentType']"
7
- :disabled="btn.disabled"
8
- :size="btn.size || 'small'"
9
- :type="btn.type"
10
- :icon="!btn.rightIcon ? btn.icon: ''"
11
- :loading="btn.loading"
12
- @click="btnClick(btn)"
3
+ <div
4
+ v-for="btn in btnList"
5
+ :key="btn.id"
6
+ v-has-permi="btn.hasPermi ? [btn.hasPermi] : undefined"
7
+ >
8
+ <template v-if="btn.isDot || btn.number">
9
+ <el-badge
10
+ :is-dot="btn.isDot"
11
+ :value="btn.number"
12
+ :style="btn.number ? 'margin-right: 20px;' : ''"
13
+ >
14
+ <el-button
15
+ v-if="!btn['componentType']"
16
+ :disabled="btn.disabled"
17
+ :size="btn.size || 'small'"
18
+ :type="btn.type"
19
+ :icon="!btn.rightIcon ? btn.icon : ''"
20
+ :loading="btn.loading"
21
+ @click="btnClick(btn)"
22
+ >{{ btn.text }}
23
+ <i
24
+ v-if="btn.rightIcon"
25
+ :class="btn.icon + ' el-icon--right'"
26
+ ></i>
27
+ </el-button>
28
+ <div v-else>
29
+ <component
30
+ :is="btn['componentType']"
31
+ :btnInfo="btn"
32
+ ></component>
33
+ </div>
34
+ </el-badge>
35
+ </template>
36
+ <template v-else>
37
+ <el-button
38
+ v-if="!btn['componentType']"
39
+ :disabled="btn.disabled"
40
+ :size="btn.size || 'small'"
41
+ :type="btn.type"
42
+ :icon="!btn.rightIcon ? btn.icon : ''"
43
+ :loading="btn.loading"
44
+ @click="btnClick(btn)"
13
45
  >{{ btn.text }}
14
- <i v-if="btn.rightIcon" :class="btn.icon + ' el-icon--right'"></i>
15
- </el-button>
16
- <div v-else>
17
- <component
18
- :is="btn['componentType']"
19
- :btnInfo="btn"
20
- ></component>
21
- </div>
46
+ <i
47
+ v-if="btn.rightIcon"
48
+ :class="btn.icon + ' el-icon--right'"
49
+ ></i>
50
+ </el-button>
51
+ <div v-else>
52
+ <component
53
+ :is="btn['componentType']"
54
+ :btnInfo="btn"
55
+ ></component>
56
+ </div>
57
+ </template>
58
+
59
+
22
60
  </div>
23
61
  </div>
24
62
  </template>
@@ -35,8 +73,8 @@ export default {
35
73
  methods: {
36
74
  // 按钮点击事件
37
75
  btnClick(btn) {
38
-
39
- if(btn.trigger){
76
+
77
+ if (btn.trigger) {
40
78
  btn.trigger()
41
79
  }
42
80
  }
@@ -48,14 +86,14 @@ export default {
48
86
  display: flex;
49
87
  align-items: center;
50
88
  flex-wrap: wrap;
89
+
51
90
  &>div {
52
91
  margin-left: 5px;
53
92
  margin-bottom: 10px;
93
+
54
94
  &:first-child {
55
95
  margin-left: 0;
56
96
  }
57
97
  }
58
98
  }
59
- </style>
60
-
61
-
99
+ </style>