Skip to content

Commit e4e7914

Browse files
committed
remove invalid dict item
1 parent 0f05fd1 commit e4e7914

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/lib/Dict.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,20 @@ function loadDict(dict, dictMeta) {
100100
dicts = []
101101
}
102102
dict.dict[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts)
103+
104+
const { Vue } = Dependency
105+
const typeLabel = dict.label[type]
106+
const keyMap = {}
107+
for(let k in typeLabel) {
108+
keyMap[k] = 0
109+
}
103110
dicts.forEach(d => {
104-
Dependency.Vue.set(dict.label[type], d.value, d.label)
111+
Vue.set(typeLabel, d.value, d.label)
112+
delete keyMap[d.value]
105113
})
114+
for(let k in keyMap) {
115+
Vue.delete(typeLabel, k)
116+
}
106117
return dicts
107118
})
108119
dict.dict[dictMeta.type].loader = loader

0 commit comments

Comments
 (0)