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

50 lines
930 B
Vue
Raw Normal View History

<script setup lang="ts">
const props = withDefaults(
defineProps<{
iconName: string;
disabled?: boolean;
color?: string;
tooltip?: string;
right?: boolean;
hover?: boolean;
}>(),
{
right: false,
disabled: false,
hover: false
}
);
defineEmits<{
(e: "click"): void;
}>();
const hoverClass = props.hover ? "hover" : "";
</script>
2019-10-02 00:14:37 +03:00
<template>
<div>
<v-tooltip :right="right" :bottom="!right" nudge-right="10" :disabled="tooltip === undefined">
<template #activator="{ on, attrs }">
<v-icon
:class="hoverClass"
:color="color"
v-bind="attrs"
:disabled="disabled"
v-on="on"
@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>