chore: 优化字典重复请求问题

This commit is contained in:
秋帆
2024-05-17 14:27:40 +08:00
parent c369b88185
commit 30222b08ab
2 changed files with 24 additions and 7 deletions

View File

@@ -25,8 +25,13 @@ const props = defineProps({
}
})
const dictItem = computed(() =>
props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value))
const dictItem = computed(() => {
try {
return props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value))
} catch (error) {
return []
}
}
)
</script>