@bsgoal/common 1.8.0 → 1.8.2
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-04-28 16:01:11
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-
|
|
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,8 +42,7 @@ const config = ref([
|
|
|
42
42
|
<template>
|
|
43
43
|
<div class="bsgoal-base-tabs-demo">
|
|
44
44
|
<div class="base_tabs_demo">
|
|
45
|
-
|
|
46
|
-
<BsgoalBaseTabs v-model="activeTabName" :config-options="config" >
|
|
45
|
+
<BsgoalBaseTabs :config-options="config" >
|
|
47
46
|
<template #tab1>
|
|
48
47
|
<div>
|
|
49
48
|
这是 tab1
|
|
@@ -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-
|
|
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 } 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,11 +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
|
|
|
62
|
+
// ---> S modelValue Get <---
|
|
63
|
+
const modelValueGet = computed(() => {
|
|
64
|
+
const { modelValue = '', configOptions = [] } = props
|
|
65
|
+
const nameList = unref(configOptions).map((mi) => mi.value)
|
|
66
|
+
const actionName = unref(modelValue)
|
|
67
|
+
return actionName || nameList[0]
|
|
68
|
+
})
|
|
69
|
+
// ---> E modelValue Get <---
|
|
70
|
+
|
|
65
71
|
// ---> S tab的切换 <---
|
|
66
72
|
const changeTab = (activeValue = '') => {
|
|
67
73
|
emits('update:modelValue', activeValue)
|
|
@@ -71,10 +77,10 @@ const changeTab = (activeValue = '') => {
|
|
|
71
77
|
<template>
|
|
72
78
|
<div class="bsgoal-base-tabs">
|
|
73
79
|
<el-tabs
|
|
74
|
-
:stretch="stretch"
|
|
75
80
|
class="bsgoal_base_tabs"
|
|
81
|
+
:stretch="stretch"
|
|
76
82
|
:type="type"
|
|
77
|
-
:model-value="
|
|
83
|
+
:model-value="modelValueGet"
|
|
78
84
|
@tab-change="changeTab"
|
|
79
85
|
>
|
|
80
86
|
<template v-for="({ label, value }, key) of configOptions" :key="key">
|