From f8866ece2a741819b16c3f4448d4ae18f2db7909 Mon Sep 17 00:00:00 2001 From: h_mo <596417202@qq.com> Date: Sun, 2 Oct 2022 19:28:01 +0800 Subject: [PATCH] feat: FontAwesomeIcon click emit --- src/components/FontAwesomeIcon/index.vue | 12 ++++++++++-- src/components/FontAwesomeIcon/props.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/FontAwesomeIcon/index.vue b/src/components/FontAwesomeIcon/index.vue index 89a7037..7aae758 100644 --- a/src/components/FontAwesomeIcon/index.vue +++ b/src/components/FontAwesomeIcon/index.vue @@ -12,6 +12,10 @@ import { FontAwesomeIconProps } from '@/components/FontAwesomeIcon/props'; const props = defineProps(FontAwesomeIconProps); + const emit = defineEmits<{ + (e: 'click'): void; + }>(); + const singleBeat = props.beat && !props.fade; const singleFade = !props.beat && props.fade; const BeatFade = props.beat && props.fade; @@ -108,15 +112,19 @@ color: props.color, 'font-size': props.size ? `${props.size}rpx` : false, }); + + const onClick = () => { + emit('click'); + };