@mptw/skylens-ui 1.4.65 → 1.4.67
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/components/SLCard.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.card
|
|
3
|
+
.card-prepend(v-if='$slots.prepend')
|
|
4
|
+
slot(name='prepend')
|
|
3
5
|
.card-header(
|
|
4
6
|
v-if='title !== "" || $slots.header || $slots.title || $slots["title-container"] || desc !== "" || $slots.desc || $slots["header-left"] || $slots["header-right"]'
|
|
5
7
|
)
|
|
@@ -75,6 +77,9 @@ export default defineComponent({
|
|
|
75
77
|
.card
|
|
76
78
|
@apply p-4 border border-primary-600 rounded bg-white shadow
|
|
77
79
|
|
|
80
|
+
.card-prepend
|
|
81
|
+
@apply mb-4
|
|
82
|
+
|
|
78
83
|
.card-header
|
|
79
84
|
@apply flex justify-between mb-4
|
|
80
85
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
ref="toggleEl"
|
|
6
6
|
@click="onToggleSelect"
|
|
7
7
|
)
|
|
8
|
-
.toggle-title {{
|
|
8
|
+
.toggle-title {{ placeholderProxy }}
|
|
9
9
|
SLIcon(icon="caret-down")
|
|
10
10
|
ClientOnly
|
|
11
11
|
Teleport(to="body")
|
|
@@ -56,10 +56,14 @@ export default defineComponent({
|
|
|
56
56
|
type: Object as PropType<{ gender: string[]; age: number[] }>,
|
|
57
57
|
default: null,
|
|
58
58
|
},
|
|
59
|
+
placeholder: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "所有受眾",
|
|
62
|
+
},
|
|
59
63
|
},
|
|
60
64
|
emits: ["update:modelValue", "update:selecting"],
|
|
61
65
|
setup(props, { emit }) {
|
|
62
|
-
const { modelValue, placement } = toRefs(props);
|
|
66
|
+
const { modelValue, placement, placeholder } = toRefs(props);
|
|
63
67
|
|
|
64
68
|
const el = shallowRef<HTMLElement | null>(null);
|
|
65
69
|
const toggleEl = shallowRef<HTMLElement | null>(null);
|
|
@@ -70,13 +74,13 @@ export default defineComponent({
|
|
|
70
74
|
let popperInstance: PopperInstance | null = null;
|
|
71
75
|
let clickSubscriber: Subscription | null = null;
|
|
72
76
|
|
|
73
|
-
const
|
|
77
|
+
const placeholderProxy = computed(() => {
|
|
74
78
|
if (
|
|
75
79
|
!modelValue.value ||
|
|
76
80
|
((!modelValue.value.gender || modelValue.value.gender.length === 0) &&
|
|
77
81
|
(!modelValue.value.age || modelValue.value.age.length === 0))
|
|
78
82
|
)
|
|
79
|
-
return
|
|
83
|
+
return placeholder.value;
|
|
80
84
|
|
|
81
85
|
return "已篩選受眾";
|
|
82
86
|
});
|
|
@@ -219,7 +223,7 @@ export default defineComponent({
|
|
|
219
223
|
toggleEl,
|
|
220
224
|
popupEl,
|
|
221
225
|
maxPopupWidth,
|
|
222
|
-
|
|
226
|
+
placeholderProxy,
|
|
223
227
|
genderOptions,
|
|
224
228
|
ageOptions,
|
|
225
229
|
genderProxy,
|