解决字典value为空问题

This commit is contained in:
神仙都没用 2023-12-29 17:01:08 +08:00
parent 5616b31c95
commit 276d1b81dc

View File

@ -34,7 +34,10 @@ const useDictStore = defineStore("dict", () => {
for (const [i, arr] of Object.entries(res)) {
arr.forEach((e) => {
e.label = e.name;
e.value = e.value ?? e.id;
if (e.value === undefined || e.value === "" || e.value === null) {
e.value = e.id;
}
});
// @ts-ignore