@mptw/skylens-ui 1.4.65 → 1.4.66

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.
@@ -5,7 +5,7 @@
5
5
  ref="toggleEl"
6
6
  @click="onToggleSelect"
7
7
  )
8
- .toggle-title {{ placeholder }}
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 placeholder = computed(() => {
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
- placeholder,
226
+ placeholderProxy,
223
227
  genderOptions,
224
228
  ageOptions,
225
229
  genderProxy,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mptw/skylens-ui",
3
3
  "type": "module",
4
- "version": "1.4.65",
4
+ "version": "1.4.66",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",