@bsgoal/common 1.8.1 → 1.8.3
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 +145 -136
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-form/demo.vue +5 -5
- package/src/components/bsgoal-base-form/index.vue +13 -3
- package/src/components/bsgoal-base-tabs/demo.vue +1 -2
- package/src/components/bsgoal-base-tabs/index.vue +8 -11
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 15:00:00
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-20 17:54:12
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\demo.vue
|
|
7
7
|
* @Description: 表单公共组件演示组件
|
|
8
8
|
*
|
|
@@ -16,7 +16,7 @@ import { ref, computed, toRefs, watch, unref } from 'vue'
|
|
|
16
16
|
import EnumType from '../../enums/enumType.js'
|
|
17
17
|
|
|
18
18
|
const values = ref({
|
|
19
|
-
prop1:
|
|
19
|
+
prop1:'222',
|
|
20
20
|
prop2: 'select1',
|
|
21
21
|
prop20: ''
|
|
22
22
|
})
|
|
@@ -29,7 +29,7 @@ const confirm = () => {
|
|
|
29
29
|
})
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
const bindModel = ref({prop1:'111'})
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
@@ -188,12 +188,12 @@ export default {
|
|
|
188
188
|
<template>
|
|
189
189
|
<div class="bsgoal-base-form-demo">
|
|
190
190
|
<BsgoalBaseForm
|
|
191
|
-
readonly
|
|
192
191
|
ref="BSGOAL_BASE_FORM_REF"
|
|
192
|
+
readonly
|
|
193
|
+
none="--"
|
|
193
194
|
:limits="10"
|
|
194
195
|
:config-options="configOptions"
|
|
195
196
|
:values="values"
|
|
196
|
-
none="--"
|
|
197
197
|
>
|
|
198
198
|
<!-- <template #prop1="{option}">
|
|
199
199
|
<div>666 {{ option }} </div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-17 11:44:29
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-20 17:51:39
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\index.vue
|
|
7
7
|
* @Description: 表单公共组件
|
|
8
8
|
*
|
|
@@ -80,6 +80,13 @@ const props = defineProps({
|
|
|
80
80
|
none: {
|
|
81
81
|
type: [String],
|
|
82
82
|
default: '无'
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* 绑定的 mdel
|
|
86
|
+
*/
|
|
87
|
+
bindModel: {
|
|
88
|
+
type: [Object],
|
|
89
|
+
default: () => ({})
|
|
83
90
|
}
|
|
84
91
|
})
|
|
85
92
|
|
|
@@ -92,7 +99,7 @@ const EL_FORM_REF = ref(null)
|
|
|
92
99
|
// 自定义指令
|
|
93
100
|
const vAlign = baseDirective.align
|
|
94
101
|
|
|
95
|
-
const model = ref(
|
|
102
|
+
const model = ref(props.bindModel)
|
|
96
103
|
const watchPropList = []
|
|
97
104
|
|
|
98
105
|
/**
|
|
@@ -111,7 +118,10 @@ watchEffect(() => {
|
|
|
111
118
|
if (![EnumType.INPUT, EnumType.INPUT_TEXT_AREA].includes(type)) {
|
|
112
119
|
watchPropList.push(prop)
|
|
113
120
|
}
|
|
114
|
-
|
|
121
|
+
const bindValue = unref(model)[prop]
|
|
122
|
+
console.log('bindValue',bindValue);
|
|
123
|
+
console.log('valuesModel[prop]',valuesModel[prop]);
|
|
124
|
+
model.value[prop] = bindValue || valuesModel[prop] || value
|
|
115
125
|
})
|
|
116
126
|
})
|
|
117
127
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-28 16:01:11
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-20
|
|
5
|
+
* @LastEditTime: 2023-05-20 16:08:59
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tabs\demo.vue
|
|
7
7
|
* @Description: tabs 标签切页 公共组件演示
|
|
8
8
|
-->
|
|
@@ -42,7 +42,6 @@ const config = ref([
|
|
|
42
42
|
<template>
|
|
43
43
|
<div class="bsgoal-base-tabs-demo">
|
|
44
44
|
<div class="base_tabs_demo">
|
|
45
|
-
{{ activeTabName }}
|
|
46
45
|
<BsgoalBaseTabs :config-options="config" >
|
|
47
46
|
<template #tab1>
|
|
48
47
|
<div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-28 16:01:06
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-20
|
|
5
|
+
* @LastEditTime: 2023-05-20 16:14:19
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tabs\index.vue
|
|
7
7
|
* @Description: tabs 标签页公共组件
|
|
8
8
|
*
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
<script setup>
|
|
17
17
|
/* setup模板
|
|
18
18
|
---------------------------------------------------------------- */
|
|
19
|
-
import { ref, unref } from 'vue'
|
|
19
|
+
import { ref, unref, computed } from 'vue'
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
/**
|
|
22
22
|
* 配置项
|
|
@@ -39,7 +39,7 @@ const props = defineProps({
|
|
|
39
39
|
type: {
|
|
40
40
|
type: [String],
|
|
41
41
|
default: '',
|
|
42
|
-
validator: (v) => ['card', 'border-card'].includes(v)
|
|
42
|
+
validator: (v) => ['card', 'border-card', ''].includes(v)
|
|
43
43
|
},
|
|
44
44
|
/**
|
|
45
45
|
* 组件绑定的值
|
|
@@ -57,20 +57,17 @@ const props = defineProps({
|
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* update:modelValue // 更新 modelValue 的方法
|
|
62
|
-
*/
|
|
63
60
|
const emits = defineEmits(['update:modelValue'])
|
|
64
61
|
|
|
65
62
|
// ---> S modelValue Get <---
|
|
66
|
-
|
|
67
|
-
// ---> E modelValue Get <---
|
|
68
|
-
const modelValueGet = () => {
|
|
63
|
+
const modelValueGet = computed(() => {
|
|
69
64
|
const { modelValue = '', configOptions = [] } = props
|
|
70
65
|
const nameList = unref(configOptions).map((mi) => mi.value)
|
|
71
|
-
const actionName = unref(modelValue)
|
|
66
|
+
const actionName = unref(modelValue)
|
|
72
67
|
return actionName || nameList[0]
|
|
73
|
-
}
|
|
68
|
+
})
|
|
69
|
+
// ---> E modelValue Get <---
|
|
70
|
+
|
|
74
71
|
// ---> S tab的切换 <---
|
|
75
72
|
const changeTab = (activeValue = '') => {
|
|
76
73
|
emits('update:modelValue', activeValue)
|