Browse Source

预加载图片

nieyuge 3 years ago
parent
commit
538bfa0ea5
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/pages/nft/add.vue

+ 11 - 0
src/pages/nft/add.vue

@@ -146,6 +146,14 @@ const getConfig = () => {
             configList.value = data.itemModels;
             maxSize.value = data.maxCollectionSize;
             selectItem.value = data.itemModels[0];
+
+            // 预加载图片
+            if (data.itemModels) {
+                data.itemModels.forEach(item => {
+                    let img = new Image()
+                        img.src = item.previewImagePath;
+                })
+            }
         }
     })
 }
@@ -346,6 +354,9 @@ onMounted(() => {
     height: calc(100% - 10px);
     background-color: #fff;
     border-radius: 20px 20px 0 0;
+    &::-webkit-scrollbar {
+        width: 0 !important;
+    }
     .title {
         padding: 22px 0;
         font-size: 20px;