@bsgoal/common 2.5.4 → 2.5.6
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/dist/index.mjs +474 -472
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-button/index.vue +2 -1
- package/src/components/bsgoal-base-select/demo.vue +25 -16
- package/src/components/bsgoal-base-select/index.vue +7 -2
package/package.json
CHANGED
|
@@ -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-25 09:
|
|
5
|
+
* @LastEditTime: 2023-05-25 09:49:24
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-button\index.vue
|
|
7
7
|
* @Description: 统一按钮
|
|
8
8
|
*
|
|
@@ -73,6 +73,7 @@ const typeGet = computed(() => {
|
|
|
73
73
|
case 'cancel':
|
|
74
74
|
return ''
|
|
75
75
|
case 'confirm':
|
|
76
|
+
case 'add':
|
|
76
77
|
return 'primary'
|
|
77
78
|
}
|
|
78
79
|
return type
|
|
@@ -18,22 +18,31 @@ const props = defineProps({})
|
|
|
18
18
|
|
|
19
19
|
const selectValue = ref('11')
|
|
20
20
|
const selectRange = ref([
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
{
|
|
22
|
+
label: '11',
|
|
23
|
+
value: '11',
|
|
24
|
+
data: { prop1: 'prop1', prop2: 'prop2' }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: '22',
|
|
28
|
+
value: '22'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: '33',
|
|
32
|
+
value: '33'
|
|
33
|
+
}
|
|
33
34
|
])
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @Author: canlong.shen
|
|
38
|
+
* @description: 触发 值变动
|
|
39
|
+
* @default:
|
|
40
|
+
* @return {*}
|
|
41
|
+
*/
|
|
42
|
+
const change = (value = '', data = {}) => {
|
|
43
|
+
console.log('value', value)
|
|
44
|
+
console.log('data', data)
|
|
45
|
+
}
|
|
37
46
|
</script>
|
|
38
47
|
<script>
|
|
39
48
|
export default {
|
|
@@ -43,8 +52,8 @@ export default {
|
|
|
43
52
|
<template>
|
|
44
53
|
<div class="bsgoal-base-select-demo">
|
|
45
54
|
<div class="base_select_demo">
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
{{ selectValue }}
|
|
56
|
+
<BsgoalBaseSelect v-model="selectValue" :range="selectRange" @change="change" />
|
|
48
57
|
</div>
|
|
49
58
|
</div>
|
|
50
59
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-05-24 11:09:59
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-25 10:25:51
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-select\index.vue
|
|
7
7
|
* @Description: Select 公共组件
|
|
8
8
|
*
|
|
@@ -43,7 +43,7 @@ const props = defineProps({
|
|
|
43
43
|
}
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
const emits = defineEmits(['update:modelValue'])
|
|
46
|
+
const emits = defineEmits(['update:modelValue','change'])
|
|
47
47
|
|
|
48
48
|
// ---> S 触发 方法 <---
|
|
49
49
|
|
|
@@ -54,7 +54,12 @@ const emits = defineEmits(['update:modelValue'])
|
|
|
54
54
|
* @return {*}
|
|
55
55
|
*/
|
|
56
56
|
const triggerChange = (value = '') => {
|
|
57
|
+
const { range = [] } = props
|
|
58
|
+
const finder = range.find((fi) => fi.value === value)
|
|
59
|
+
const data = finder ? finder.data : null
|
|
60
|
+
|
|
57
61
|
emits('update:modelValue', value)
|
|
62
|
+
emits('change', value , data)
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
// ---> E 触发 方法 <---
|