Files
PhotonVision/photon-client/src/components/common/pv-icon.vue

47 lines
874 B
Vue
Raw Normal View History

<script setup lang="ts">
withDefaults(
defineProps<{
iconName: string;
disabled?: boolean;
color?: string;
tooltip?: string;
right?: boolean;
hover?: boolean;
}>(),
{
right: false,
disabled: false,
hover: false
}
);
defineEmits<{
(e: "click"): void;
}>();
</script>
2019-10-02 00:14:37 +03:00
<template>
<div>
<v-tooltip :right="right" :location="!right ? 'bottom' : undefined" offset="10" :disabled="tooltip === undefined">
<template #activator="{ props }">
<v-icon
:class="hover ? 'hover' : ''"
:color="color"
v-bind="props"
:disabled="disabled"
@click="$emit('click')"
>
{{ iconName }}
</v-icon>
</template>
<span>{{ tooltip }}</span>
</v-tooltip>
</div>
2019-10-02 00:14:37 +03:00
</template>
2019-10-10 22:40:51 +03:00
<style scoped>
.hover:hover {
color: white !important;
}
</style>