style(components): fixup icon
This commit is contained in:
		
							parent
							
								
									f1190af5df
								
							
						
					
					
						commit
						fe2c471794
					
				| @ -1,23 +1,32 @@ | |||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { string } from 'yup'; | 	import { theme } from "ant-design-vue"; | ||||||
| 	const propo = defineProps<{name: string; istyle: "regular" | "light" | "solid" | "thin"; size?: number;}>() | 	const { useToken } = theme; | ||||||
|  | 	const { token } = useToken(); | ||||||
|  | 
 | ||||||
|  | 	const col = token.value.colorText; | ||||||
|  | 	const propo = defineProps<{ | ||||||
|  | 		name: string; | ||||||
|  | 		icolor?: string; | ||||||
|  | 		istyle: "regular" | "light" | "solid" | "thin"; | ||||||
|  | 		size?: number; | ||||||
|  | 		proportionate?: boolean; | ||||||
|  | 	}>(); | ||||||
|  | 	const propUnit = propo.proportionate ? "em" : "px"; | ||||||
| 	const styleMap = { | 	const styleMap = { | ||||||
| 		"regular": "r", | 		regular: "r", | ||||||
| 		"light": "l", | 		light: "l", | ||||||
| 		"solid": "s", | 		solid: "s", | ||||||
| 		"thin": "t" | 		thin: "t", | ||||||
| 	} | 	}; | ||||||
| 
 | 	const pixi = propo.size ? `${propo.size}${propUnit}` : "inherit"; | ||||||
| 
 |  | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <template> | <template> | ||||||
| 	<span :style="{display: 'inline-block', width: `${size || 20}px`, height: `${size || 20}px`}"> | 	<i | ||||||
| 		<i :style="{ | 		:style="{ | ||||||
| 			fontSize: `${size || 20}px`,  | 			fontSize: `${size}${propUnit}`, | ||||||
| 			display: 'inline-block',  | 			color: icolor || 'currentcolor', | ||||||
| 			width: 'inherit',  | 		}" | ||||||
| 			height: 'inherit' | 		:class="`fa${styleMap[istyle]} fa-${name}`" | ||||||
| 		}" :class="`fa${styleMap[istyle]} fa-${name}`"/> | 	/> | ||||||
| 	</span> |  | ||||||
| </template> | </template> | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user