2023-10-11 16:40:30 -04:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { theme } from "ant-design-vue";
|
|
|
|
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 = {
|
|
|
|
regular: "r",
|
|
|
|
light: "l",
|
|
|
|
solid: "s",
|
|
|
|
thin: "t",
|
|
|
|
};
|
|
|
|
const pixi = propo.size ? `${propo.size}${propUnit}` : "inherit";
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<i
|
|
|
|
:style="{
|
|
|
|
fontSize: `${size}${propUnit}`,
|
|
|
|
color: icolor || 'currentcolor',
|
|
|
|
}"
|
|
|
|
:class="`fa${styleMap[istyle]} fa-${name}`"
|
|
|
|
/>
|
|
|
|
</template>
|