@bsgoal/common 1.9.8 → 1.9.9
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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-05-18 16:24:31
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-23 16:58:44
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-button\demo.vue
|
|
7
7
|
* @Description: 按钮 演示
|
|
8
8
|
*
|
|
@@ -29,6 +29,9 @@ export default {
|
|
|
29
29
|
</script>
|
|
30
30
|
<template>
|
|
31
31
|
<div class="bsgoal-base-button-demo">
|
|
32
|
+
<BsgoalBaseButton :task="task" mode="cancel" content="取消" > </BsgoalBaseButton>
|
|
33
|
+
<BsgoalBaseButton :task="task" mode="confirm" content="取消" > </BsgoalBaseButton>
|
|
34
|
+
|
|
32
35
|
<BsgoalBaseButton :task="task" plain > </BsgoalBaseButton>
|
|
33
36
|
<BsgoalBaseButton :task="task" mode="add"> </BsgoalBaseButton>
|
|
34
37
|
<BsgoalBaseButton :task="task" mode="delete"> </BsgoalBaseButton>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-05-18 16:24:25
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-23 16:58:12
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-button\index.vue
|
|
7
7
|
* @Description: 统一按钮
|
|
8
8
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/* setup模板
|
|
13
13
|
---------------------------------------------------------------- */
|
|
14
14
|
import { ref, unref, computed } from 'vue'
|
|
15
|
-
import { Delete, Plus } from '@element-plus/icons-vue'
|
|
15
|
+
import { Delete, Plus, CloseBold, Select } from '@element-plus/icons-vue'
|
|
16
16
|
|
|
17
17
|
// props
|
|
18
18
|
const props = defineProps({
|
|
@@ -24,7 +24,7 @@ const props = defineProps({
|
|
|
24
24
|
},
|
|
25
25
|
type: {
|
|
26
26
|
type: [String],
|
|
27
|
-
default: '
|
|
27
|
+
default: '',
|
|
28
28
|
validator: (v) => ['primary', 'success', 'warning', 'danger', 'info'].includes(v)
|
|
29
29
|
},
|
|
30
30
|
icon: {
|
|
@@ -38,7 +38,7 @@ const props = defineProps({
|
|
|
38
38
|
mode: {
|
|
39
39
|
type: [String],
|
|
40
40
|
default: 'default',
|
|
41
|
-
validator: (v) => ['add', 'delete', 'edit', 'detail','default'].includes(v)
|
|
41
|
+
validator: (v) => ['add', 'delete', 'edit', 'detail', 'default', 'cancel'].includes(v)
|
|
42
42
|
},
|
|
43
43
|
values: {
|
|
44
44
|
type: [Array, Object],
|
|
@@ -70,6 +70,10 @@ const typeGet = computed(() => {
|
|
|
70
70
|
switch (mode) {
|
|
71
71
|
case 'delete':
|
|
72
72
|
return 'danger'
|
|
73
|
+
case 'cancel':
|
|
74
|
+
return ''
|
|
75
|
+
case 'confirm':
|
|
76
|
+
return 'primary'
|
|
73
77
|
}
|
|
74
78
|
return type
|
|
75
79
|
})
|
|
@@ -81,9 +85,26 @@ const iconGet = computed(() => {
|
|
|
81
85
|
return Delete
|
|
82
86
|
case 'add':
|
|
83
87
|
return Plus
|
|
88
|
+
case 'cancel':
|
|
89
|
+
return CloseBold
|
|
90
|
+
case 'confirm':
|
|
91
|
+
return Select
|
|
84
92
|
}
|
|
85
93
|
return icon
|
|
86
94
|
})
|
|
95
|
+
const contentGet = computed(() => {
|
|
96
|
+
const { mode = '', content = '' } = props
|
|
97
|
+
|
|
98
|
+
switch (mode) {
|
|
99
|
+
case 'cancel':
|
|
100
|
+
return '取消'
|
|
101
|
+
case 'confirm':
|
|
102
|
+
return '确认'
|
|
103
|
+
case 'add':
|
|
104
|
+
return '新增'
|
|
105
|
+
}
|
|
106
|
+
return content
|
|
107
|
+
})
|
|
87
108
|
|
|
88
109
|
// ---> E 模式 <---
|
|
89
110
|
</script>
|
|
@@ -97,7 +118,7 @@ export default {
|
|
|
97
118
|
<div class="base_button" @click="triggerClick">
|
|
98
119
|
<slot :loading="loading">
|
|
99
120
|
<el-button :type="typeGet" :icon="iconGet" :loading="loading" :plain="plain">{{
|
|
100
|
-
|
|
121
|
+
contentGet
|
|
101
122
|
}}</el-button>
|
|
102
123
|
</slot>
|
|
103
124
|
</div>
|