Commit 8138f260 by jml0128

fix

1 parent be27e40e
{ {
"name": "xrk-bi", "name": "xrk-bi",
"version": "0.1.7", "version": "0.1.8",
"description": "xrk-bi", "description": "xrk-bi",
"author": "xrk", "author": "xrk",
"main": "dist/bundler.js", "main": "dist/bundler.js",
......
...@@ -35,6 +35,18 @@ export default { ...@@ -35,6 +35,18 @@ export default {
} else { } else {
this[pageKey] = pageInfo; this[pageKey] = pageInfo;
} }
},
preloadImg(url) {
return new Promise(resolve => {
const img = new Image();
img.src = url;
img.onload = () => {
resolve('load finish');
};
img.onerror = () => {
resolve('load fail');
};
});
} }
} }
}; };
...@@ -462,7 +462,8 @@ export default { ...@@ -462,7 +462,8 @@ export default {
this.dealChoice(topicInfo.data.data || []); this.dealChoice(topicInfo.data.data || []);
this.dealChoiceMixin(topicMixinInfo.data.data || []); this.dealChoiceMixin(topicMixinInfo.data.data || []);
this.coverList = tempaletList.data.data || []; this.coverList = tempaletList.data.data || [];
this.$nextTick(() => { this.$nextTick(async () => {
await this.preloadImg(this.coverUrl);
window.status = '1'; window.status = '1';
}); });
} }
......
...@@ -496,7 +496,8 @@ export default { ...@@ -496,7 +496,8 @@ export default {
this.dealChoice(topicInfo.data.data || []); this.dealChoice(topicInfo.data.data || []);
this.dealChoiceMixin(topicMixinInfo.data.data || []); this.dealChoiceMixin(topicMixinInfo.data.data || []);
this.coverList = tempaletList.data.data || []; this.coverList = tempaletList.data.data || [];
this.$nextTick(() => { this.$nextTick(async () => {
await this.preloadImg(this.coverUrl);
window.status = '1'; window.status = '1';
}); });
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!