feat(查询组件): 下拉树多选的情况下,增加「清空」和「确定」button

This commit is contained in:
dataeaseShu
2024-08-30 16:23:57 +08:00
parent d9438d8ace
commit 61927cfad5
2 changed files with 7 additions and 2 deletions

View File

@@ -57,6 +57,11 @@ const { config } = toRefs(props)
const multiple = ref(false)
const treeSelectConfirm = val => {
treeValue.value = val
handleValueChange()
}
const handleValueChange = () => {
const value = Array.isArray(treeValue.value) ? [...treeValue.value] : treeValue.value
if (!props.isConfig) {
@@ -222,7 +227,7 @@ const selectStyle = computed(() => {
:data="treeOptionList"
clearable
v-if="multiple && !loading"
@change="handleValueChange"
@treeSelectConfirm="treeSelectConfirm"
:render-after-expand="false"
show-checkbox
showBtn