This commit is contained in:
2024-10-22 09:09:41 +08:00
parent ef869c5ab1
commit 3a9b2d55c6
99 changed files with 4506 additions and 3465 deletions

View File

@@ -49,21 +49,27 @@ const _sfc_main = defineComponent({
onMounted(() => {
initTreeData();
});
watch(() => props.options, () => {
initTreeData();
});
watch(() => props.modelValue, () => {
if (watchModelValue.value) {
if (props.modelValue === null || props.modelValue === "") {
onClear();
} else {
updateDisplayByModelValue();
}
setTimeout(() => {
watchModelValue.value = true;
}, 0);
watch(
() => props.options,
() => {
initTreeData();
}
});
);
watch(
() => props.modelValue,
() => {
if (watchModelValue.value) {
if (props.modelValue === null || props.modelValue === "") {
onClear();
} else {
updateDisplayByModelValue();
}
setTimeout(() => {
watchModelValue.value = true;
}, 0);
}
}
);
const watchModelValue = ref(true);
const treeData = ref([]);
const initTreeData = () => {
@@ -89,7 +95,9 @@ const _sfc_main = defineComponent({
let valueData = props.modelValue.split(props.decollator);
for (let index2 = 0; index2 < valueData.length; index2++) {
const element = valueData[index2];
let selectIndex = treeData.value[index2].data.findIndex((e) => e.value === element);
let selectIndex = treeData.value[index2].data.findIndex(
(e) => e.value === element
);
if (selectIndex == -1) {
break;
}