Sfoglia il codice sorgente

【修复】图标 URL 的路径问题

- 在 index.html 文件中,更新了图标内容的生成逻辑
- 在有图标 URL 时,将图标路径从 pkg.icon 改为 pkg.location/pkg.icon
- 这个修改确保了图标能够正确加载,解决了路径不正确导致的图标显示问题
PJ568 1 anno fa
parent
commit
5a970e8560
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      index.html

+ 1 - 1
index.html

@@ -189,7 +189,7 @@
               let iconContent = "";
               if (pkg.icon) {
                 // 如果有图标URL,使用img标签
-                iconContent = `<img src="${pkg.icon}" alt="${pkg.name}" style="width:100%;height:100%;object-fit:contain;">`;
+                iconContent = `<img src="${pkg.location}/${pkg.icon}" alt="${pkg.name}" style="width:100%;height:100%;object-fit:contain;">`;
               } else {
                 // 如果没有图标,显示名称首字符
                 iconContent = pkg.name.charAt(0).toUpperCase();