Browse Source

代码生成后 index.vue 编辑表单中字典返现问题

master
LIONCITYS\lioncity 4 years ago
parent
commit
5c543fdf26
  1. 9
      src/components/Dict/Dict.js

9
src/components/Dict/Dict.js

@ -18,8 +18,13 @@ export default class Dict {
ps.push(getDictDetail(n).then(data => {
this.dict[n].splice(0, 0, ...data.content)
data.content.forEach(d => {
Vue.set(this.dict.dict[n], d.value, d)
Vue.set(this.dict.label[n], d.value, d.label)
if (parseFloat(d.value).toString() == 'NaN') {
Vue.set(this.dict.dict[n], d.value, d)
Vue.set(this.dict.label[n], d.value, d.label)
} else {
Vue.set(this.dict.dict[n], parseFloat(d.value), d)
Vue.set(this.dict.label[n], parseFloat(d.value), d.label)
}
})
}))
})

Loading…
Cancel
Save