Skip to content

Commit

Permalink
feat: add hover prop
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Jul 15, 2024
1 parent ed2cec3 commit 02fd3f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/components/PhosphorIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ const props = defineProps({
spinDuration: {
type: String,
default: '1s'
},
hover: {
type: Boolean
}
})
Expand All @@ -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]
Expand Down Expand Up @@ -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,
}
})
</script>
Expand Down

0 comments on commit 02fd3f6

Please sign in to comment.