gyyg-components 0.2.21 → 0.2.23

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