Pārlūkot izejas kodu

[stdf]Add JSDoc

dufu1991 2 gadi atpakaļ
vecāks
revīzija
a3a72ffa7b

+ 0 - 8
demo/src/routes/zh_CN/icon/+page.svelte

@@ -6,7 +6,6 @@
 </script>
 
 <div class="felx felx-col space-y-12 px-4 py-8">
-	<!-- 基础用法 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">基础用法</div>
 		<div class="flex flex-wrap justify-between">
@@ -18,7 +17,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 跟随主题色 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">跟随主题色</div>
 		<div class="flex flex-wrap justify-between">
@@ -29,7 +27,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 不同大小 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">不同大小</div>
 		<div class="flex flex-wrap justify-between">
@@ -41,7 +38,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 不同透明度 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">不同透明度</div>
 		<div class="flex flex-wrap justify-between">
@@ -53,7 +49,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 自定义颜色(通过 injClass) -->
 	<div>
 		<div class="mb-2 font-bold text-xl">
 			自定义颜色<span class="ml-2 text-xs font-normal">通过 injClass</span>
@@ -66,7 +61,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 自定义颜色(通过 slot) -->
 	<div>
 		<div class="mb-2 font-bold text-xl">
 			自定义颜色<span class="ml-2 text-xs font-normal">通过 slot</span>
@@ -83,7 +77,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 插槽 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">插槽</div>
 		<div class="flex flex-wrap justify-between">
@@ -102,7 +95,6 @@
 			{/each}
 		</div>
 	</div>
-	<!-- 偏移 -->
 	<div>
 		<div class="mb-2 font-bold text-xl">偏移</div>
 		<div class="flex flex-wrap justify-between">

+ 43 - 14
packages/stdf/components/icon/Icon.svelte

@@ -1,30 +1,59 @@
 <script>
-	//图标名称
-	//Icon name
+	/**
+	 * 图标名称
+	 * Icon name
+	 * @type {string}
+	 * @default ''
+	 */
 	export let name = '';
 
-	//图标大小
-	//Icon size
+	/**
+	 * 图标大小
+	 * Icon size
+	 * @type {number}
+	 * @default 24
+	 */
 	export let size = 24;
 
-	//是否跟随主题色
-	//Whether to follow the theme color
+	/**
+	 * 是否跟随主题色
+	 * Whether to follow the theme color
+	 * @type {boolean}
+	 * @default false
+	 */
 	export let theme = false;
 
-	//透明度
-	//Opacity
+	/**
+	 * 透明度
+	 * Opacity
+	 * @type {number}
+	 * @range 0 - 1
+	 * @default 1
+	 */
 	export let alpha = 1;
 
-	//项目存放 symbol.svg 文件的路径
-	//The path where the symbol.svg file is stored in the project
+	/**
+	 * 项目存放 symbol.svg 文件的路径
+	 * The path where the symbol.svg file is stored in the project
+	 * @type {string}
+	 * @default 'fonts/symbol.svg'
+	 */
 	export let path = 'fonts/symbol.svg';
 
-	//偏移量
-	//Offset
+	/**
+	 * 偏移量
+	 * Offset
+	 * @type {number}
+	 * @default 0
+	 */
 	export let top = 0;
 
-	//注入CSS
-	//Inject CSS
+	/**
+	 * 注入 CSS
+	 * Inject CSS
+	 * @type {string}
+	 * @default ''
+	 */
 	export let injClass = '';
 </script>