2022-11-24 14:04:20 +09:00
|
|
|
<script setup lang="ts">
|
|
|
|
defineProps<{
|
|
|
|
text?: string | number
|
|
|
|
color: string
|
|
|
|
icon: string
|
2022-11-24 17:34:05 +09:00
|
|
|
activeIcon?: string
|
2022-11-24 14:04:20 +09:00
|
|
|
hover: string
|
|
|
|
groupHover: string
|
|
|
|
active?: boolean
|
|
|
|
disabled?: boolean
|
|
|
|
}>()
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
inheritAttrs: false,
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-24 17:34:05 +09:00
|
|
|
<button
|
|
|
|
flex gap-1 items-center rounded :hover="`op100 ${hover}`" group
|
|
|
|
:class="active ? [color, 'op100'] : 'op50'"
|
|
|
|
v-bind="$attrs"
|
|
|
|
>
|
|
|
|
<div rounded-full p2 :group-hover="groupHover">
|
|
|
|
<div :class="[active && activeIcon ? activeIcon : icon, { 'pointer-events-none': disabled }]" />
|
|
|
|
</div>
|
2022-11-24 14:04:20 +09:00
|
|
|
|
2022-11-24 17:34:05 +09:00
|
|
|
<span v-if="text">{{ text }}</span>
|
|
|
|
</button>
|
2022-11-24 14:04:20 +09:00
|
|
|
</template>
|