all
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user