浏览代码

feat: 添加图标

bill 4 天之前
父节点
当前提交
51744203c8
共有 4 个文件被更改,包括 16 次插入6 次删除
  1. 3 0
      public/icons/dot.svg
  2. 3 0
      public/icons/hand_l.svg
  3. 3 0
      public/icons/hand_r.svg
  4. 7 6
      src/example/constant.ts

+ 3 - 0
public/icons/dot.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M26.6693 16.0026C26.6693 21.8936 21.8936 26.6693 16.0026 26.6693C10.1116 26.6693 5.33594 21.8936 5.33594 16.0026C5.33594 10.1116 10.1116 5.33594 16.0026 5.33594C21.8936 5.33594 26.6693 10.1116 26.6693 16.0026Z" fill="#007BFF"/>
+</svg>

文件差异内容过多而无法显示
+ 3 - 0
public/icons/hand_l.svg


文件差异内容过多而无法显示
+ 3 - 0
public/icons/hand_r.svg


+ 7 - 6
src/example/constant.ts

@@ -236,12 +236,13 @@ export const styleIconMap = {
 };
 
 export const traceIconMap: Record<string, string> = {};
-for (const icon of traceIcons) {
-  traceIconMap[icon.icon + ".png"] = icon.icon;
-  const ndx = icon.icon.lastIndexOf("_o");
+const trIcons = traceIcons.map((item) => item.icon);
+trIcons.push("dot", "hand_l", "hand_r");
+for (const icon of trIcons) {
+  traceIconMap[icon + ".png"] = icon;
+  const ndx = icon.lastIndexOf("_o");
   if (~ndx) {
-    const name = icon.icon.substring(0, ndx);
-    traceIconMap[name + ".png"] = icon.icon;
+    const name = icon.substring(0, ndx);
+    traceIconMap[name + ".png"] = icon;
   }
 }
-console.log(traceIconMap);