34 lines
704 B
Vue
34 lines
704 B
Vue
<script setup lang="ts">
|
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
|
|
interface Props {
|
|
/** FontAwesome 图标名称(不含 fa- 前缀) */
|
|
icon: string;
|
|
/** 图标大小 */
|
|
size?: 'xs' | 'sm' | 'lg' | 'xl' | '2x' | '3x' | '4x' | '5x';
|
|
/** 旋转动画 */
|
|
spin?: boolean;
|
|
/** 脉冲动画 */
|
|
pulse?: boolean;
|
|
/** 旋转角度 */
|
|
rotation?: 0 | 90 | 180 | 270;
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
size: undefined,
|
|
spin: false,
|
|
pulse: false,
|
|
rotation: undefined,
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<FontAwesomeIcon
|
|
:icon="`fa-solid fa-${icon}`"
|
|
:size="size"
|
|
:spin="spin"
|
|
:pulse="pulse"
|
|
:rotation="rotation"
|
|
/>
|
|
</template>
|