fix: 树形选择器点击节点选中数据无效

This commit is contained in:
fit2cloud-chenyw 2024-03-06 15:03:07 +08:00
parent 8d461c57bd
commit c97940b4b0

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes'
import { ElTreeSelect } from 'element-plus-secondary'
import { computed, reactive, ref, PropType, toRefs } from 'vue'
import { computed, reactive, ref, PropType, toRefs, watch } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
interface TreeConfig {
@ -60,6 +60,15 @@ const optionListNotSelect = computed(() => {
const clear = () => {
state.currentStatus = []
}
watch(
() => state.currentStatus,
() => {
treeChange()
},
{
immediate: true
}
)
defineExpose({
clear
})
@ -74,7 +83,6 @@ defineExpose({
ref="filterTree"
:teleported="false"
style="width: 100%"
@change="treeChange"
v-model="state.currentStatus"
:data="optionListNotSelect"
:highlight-current="true"