jobdone-shared-files 1.0.47 → 1.0.49
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/autocompleteSelect.vue +5 -5
- package/package.json +1 -1
package/autocompleteSelect.vue
CHANGED
|
@@ -222,7 +222,7 @@ const filterList = computed(() => {
|
|
|
222
222
|
|
|
223
223
|
// 從選項列表中挖出整個選中的item,因選中的值(可能是某個key)
|
|
224
224
|
const selectedItem = computed(() => {
|
|
225
|
-
if (
|
|
225
|
+
if (props.selectedData === null || props.selectedData === undefined || ((typeof props.selectedData) === 'object' && Object.keys(props.selectedData).length === 0)) {
|
|
226
226
|
return
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -262,10 +262,10 @@ function previewAdjust(itemObj) {
|
|
|
262
262
|
|
|
263
263
|
// 選中的值的顯示
|
|
264
264
|
const selectedPreviewText = computed(() => {
|
|
265
|
-
if (selectedItem.value ||
|
|
266
|
-
return
|
|
265
|
+
if (selectedItem.value === '' || selectedItem.value === null || selectedItem.value === undefined || ((typeof selectedItem.value) === 'object' && Object.keys(selectedItem.value).length === 0)) {
|
|
266
|
+
return props.placeholder
|
|
267
267
|
}
|
|
268
|
-
return
|
|
268
|
+
return previewAdjust(selectedItem.value)
|
|
269
269
|
})
|
|
270
270
|
|
|
271
271
|
// 清除選擇內容
|
|
@@ -276,7 +276,7 @@ function clearSelected() {
|
|
|
276
276
|
|
|
277
277
|
// 選擇送出
|
|
278
278
|
function selectConfirm(v) {
|
|
279
|
-
if (
|
|
279
|
+
if (v === null || v === undefined || ((typeof v) === 'object' && Object.keys(v).length === 0)) {
|
|
280
280
|
return
|
|
281
281
|
}
|
|
282
282
|
emit('select', JSON.parse(JSON.stringify(v)))
|