feat: 优化xtselect

This commit is contained in:
caoqianming 2025-12-19 15:46:31 +08:00
parent e5c80121d8
commit 9806e264d8
1 changed files with 5 additions and 7 deletions

View File

@ -89,7 +89,7 @@ const props = defineProps({
options: { type: Array, default: null },
});
const emit = defineEmits(["update:modelValue", "update:obj", "update:label", "change"]);
const emit = defineEmits(["update:modelValue", "update:obj", "change"]);
const selectable = (row) => row.count_canhandover?row.count_canhandover>0:true;
// popover
const showPopover = ref(false);
@ -189,8 +189,8 @@ const rowClick = (row) => {
selectLabel.value = row[props.labelField];
selectValue.value = row[props.valueField];
showPopover.value = false;
emit("change", row);
}
emit("change", selectObj.value);
};
const handleClear = () => {
@ -202,8 +202,7 @@ const handleClear = () => {
selectLabel.value = "";
selectValue.value = null;
}
emit("update:label", "");
emit("change", selectObj.value);
emit("change", props.multiple ? [] : null);
};
const tdChange = (res, tableData) => {
@ -219,8 +218,7 @@ const selectionChange = (val) => {
selectLabel.value = val
.map((item) => item[props.labelField])
.join(props.splitField);
}
emit("update:label", val);
emit("change", selectObj.value);
emit("change", val);
}
};
</script>