From 8d821672b283d14fd8bad122717d2428cb35a9f6 Mon Sep 17 00:00:00 2001 From: "LIONCITYS\\lioncity" <18026623439@163.com> Date: Tue, 24 Nov 2020 15:03:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=9B=9E=E6=98=BE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dict/Dict.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/Dict/Dict.js b/src/components/Dict/Dict.js index 94ecc89..cea1ff4 100644 --- a/src/components/Dict/Dict.js +++ b/src/components/Dict/Dict.js @@ -18,13 +18,11 @@ export default class Dict { ps.push(getDictDetail(n).then(data => { this.dict[n].splice(0, 0, ...data.content) data.content.forEach(d => { - 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) + if (parseInt(d.value).toString() != 'NaN') { + d.value = parseInt(d.value) } + Vue.set(this.dict.dict[n], d.value, d) + Vue.set(this.dict.label[n], d.value, d.label) }) })) })