refactor: 字典类型支持数组
This commit is contained in:
@@ -10,7 +10,7 @@ interface DictTagGroupProps {
|
|||||||
/**
|
/**
|
||||||
* 字典类型
|
* 字典类型
|
||||||
*/
|
*/
|
||||||
type: string;
|
type: string[];
|
||||||
/**
|
/**
|
||||||
* 字典值
|
* 字典值
|
||||||
*/
|
*/
|
||||||
@@ -31,9 +31,10 @@ const dictTag = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dictTagGroup: any[] = [];
|
const dictTagGroup: any[] = [];
|
||||||
props.value.forEach((value) => {
|
props.type.forEach((type) => {
|
||||||
|
props.value?.forEach((value) => {
|
||||||
// 获取字典对象
|
// 获取字典对象
|
||||||
const dict = getDictObj(props.type, String(value));
|
const dict = getDictObj(type, String(value));
|
||||||
if (!dict) {
|
if (!dict) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -64,6 +65,7 @@ const dictTag = computed(() => {
|
|||||||
colorType,
|
colorType,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return dictTagGroup;
|
return dictTagGroup;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user