mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
解决字典value为空问题
This commit is contained in:
parent
5616b31c95
commit
276d1b81dc
@ -34,7 +34,10 @@ const useDictStore = defineStore("dict", () => {
|
|||||||
for (const [i, arr] of Object.entries(res)) {
|
for (const [i, arr] of Object.entries(res)) {
|
||||||
arr.forEach((e) => {
|
arr.forEach((e) => {
|
||||||
e.label = e.name;
|
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
|
// @ts-ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user