Skip to content

Commit 564d470

Browse files
committed
perf: 优化字典数组条件判断
1 parent a193744 commit 564d470

File tree

1 file changed

+1
-1
lines changed
  • ruoyi-fastapi-frontend/src/components/DictTag

1 file changed

+1
-1
lines changed

ruoyi-fastapi-frontend/src/components/DictTag/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const values = computed(() => {
5555
const unmatch = computed(() => {
5656
unmatchArray.value = [];
5757
// 没有value不显示
58-
if (props.value === null || typeof props.value === 'undefined' || props.value === '' || props.options.length === 0) return false
58+
if (props.value === null || typeof props.value === 'undefined' || props.value === '' || !Array.isArray(props.options) || props.options.length === 0) return false
5959
// 传入值为数组
6060
let unmatch = false // 添加一个标志来判断是否有未匹配项
6161
values.value.forEach(item => {

0 commit comments

Comments
 (0)