gtsoft-snail-job-admin/src/components/common/pin-toggler.vue
2024-04-28 14:06:34 +08:00

27 lines
515 B
Vue

<script lang="ts" setup>
import { computed } from 'vue';
import { $t } from '@/locales';
defineOptions({ name: 'PinToggler' });
interface Props {
pin?: boolean;
}
const props = defineProps<Props>();
const icon = computed(() => (props.pin ? 'mdi-pin-off' : 'mdi-pin'));
</script>
<template>
<ButtonIcon
:tooltip-content="pin ? $t('icon.unpin') : $t('icon.pin')"
tooltip-placement="bottom-start"
:z-index="100"
>
<SvgIcon :icon="icon" />
</ButtonIcon>
</template>
<style scoped></style>