提交 724ad84b 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

fix: 信息多次叠加的问题

上级 09731260
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
const res = uni.getAppBaseInfo(); const res = uni.getAppBaseInfo();
const json = JSON.stringify(res); const json = JSON.stringify(res);
const result = JSON.parse<Map<string, any>>(json); const result = JSON.parse<Map<string, any>>(json);
this.items = [] as Item[];
result.forEach((value, key) => { result.forEach((value, key) => {
const item = { const item = {
label: key, label: key,
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
const res = uni.getDeviceInfo(); const res = uni.getDeviceInfo();
const json = JSON.stringify(res); const json = JSON.stringify(res);
const result = JSON.parse<Map<string, any>>(json); const result = JSON.parse<Map<string, any>>(json);
this.items = [] as Item[];
result.forEach((value, key) => { result.forEach((value, key) => {
const item = { const item = {
label: key, label: key,
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
const json = JSON.stringify(res); const json = JSON.stringify(res);
const result = JSON.parse<Map<string, any>>(json); const result = JSON.parse<Map<string, any>>(json);
this.items = [] as Item[];
result.forEach((value, key) => { result.forEach((value, key) => {
const item = { const item = {
label: key, label: key,
......
...@@ -39,13 +39,14 @@ ...@@ -39,13 +39,14 @@
const res = uni.getWindowInfo(); const res = uni.getWindowInfo();
const json = JSON.stringify(res); const json = JSON.stringify(res);
const result = JSON.parse<Map<string, any>>(json); const result = JSON.parse<Map<string, any>>(json);
this.items = [] as Item[];
result.forEach((value, key) => { result.forEach((value, key) => {
const item = { const item = {
label: key, label: key,
value: "" + value value: "" + value
} as Item; } as Item;
this.items.push(item); this.items.push(item);
}) })
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册