Jelajahi Sumber

[stdf]Change Icon Props path default value

dufu1991 3 tahun lalu
induk
melakukan
a424678d80
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 3 3
      packages/stdf/components/icon/Icon.svelte
  2. 1 1
      packages/stdf/package.json

+ 3 - 3
packages/stdf/components/icon/Icon.svelte

@@ -17,7 +17,7 @@
 
     //项目存放 symbol.svg 文件的路径
     //The path where the symbol.svg file is stored in the project
-    export let path = '/assets/fonts/symbol.svg';
+    export let path = 'fonts/symbol.svg';
 
     //偏移量
     //Offset
@@ -32,8 +32,8 @@
     {#if name === 'slot'}
         <slot><span>无插槽内容!</span></slot>
     {:else}
-        <svg width={size} height={size} style="fill: currentColor;fill-opacity :{alpha};display: inline;" viewBox="0 0 512 512">
-            <use xlink:href="{path}#{name}" />
+        <svg width={size} height={size} style="fill: currentColor;fill-opacity: {alpha};display: inline;">
+            <use xlink:href="/{path}#{name}" />
         </svg>
     {/if}
 </i>

+ 1 - 1
packages/stdf/package.json

@@ -1,6 +1,6 @@
 {
     "name": "stdf",
-    "version": "0.2.4",
+    "version": "0.2.5",
     "description": "Mobile web component library based on Svelte and Tailwind",
     "main": "dist/components/index.js",
     "scripts": {