From 02fd3f66503578ae783370bd60595c3b39735361 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Mon, 15 Jul 2024 11:45:09 +0000 Subject: [PATCH] feat: add hover prop --- lib/components/PhosphorIcon.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/components/PhosphorIcon.vue b/lib/components/PhosphorIcon.vue index 798cfa89..6bbeb9a1 100644 --- a/lib/components/PhosphorIcon.vue +++ b/lib/components/PhosphorIcon.vue @@ -114,6 +114,9 @@ const props = defineProps({ spinDuration: { type: String, default: '1s' + }, + hover: { + type: Boolean } }) @@ -138,6 +141,15 @@ watch( } ) +watch( + () => props.hover, + () => { + hover.value = props.hover + }, + { immediate: true } +) + + const weight = computed(() => { if (hover.value && props.hoverWeight) { return WEIGHTS[props.hoverWeight] @@ -190,6 +202,7 @@ const classList = computed(() => { return { [`phosphor-icon--size-${props.size}`]: hasSize.value, [`phosphor-icon--has-size`]: hasSize.value, + [`phosphor-icon--hover`]: hover.value, } })