bill преди 2 месеца
родител
ревизия
6c8a02c71d
променени са 2 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 1 1
      src/example/components/slide/slide.vue
  2. 9 1
      src/example/fuse/views/tabulation/slide-icons.vue

+ 1 - 1
src/example/components/slide/slide.vue

@@ -48,7 +48,7 @@ const selectHandler = async (val: string) => {
   if (menu.handler) {
     menu.handler(props.draw);
     nextTick(() => (active.value = undefined));
-  } else {
+  } else if (menu.payload) {
     props.draw.enterDrawShape(menu.payload.type, menu.payload.preset, menu.single);
   }
 };

+ 9 - 1
src/example/fuse/views/tabulation/slide-icons.vue

@@ -52,13 +52,21 @@ const drawIcon = async (url: string, name: string, item: any) => {
     size.width = (maxSize / svgContent.height) * svgContent.width;
   }
 
+  const color = {
+    fill: svgContent.paths[0]?.fill,
+    stroke: svgContent.paths[0]?.stroke,
+  };
+  if (!color.fill && !color.stroke) {
+    color.stroke = "#000000";
+  }
+
   props.draw.enterDrawShape(
     "icon",
     {
       url,
       ...size,
       name,
-      fill: "#000000",
+      ...color,
       ...(item.parse || {}),
     },
     true