ruoyi-plus-soybean/src/components/common/pin-toggler.vue

27 lines
515 B
Vue
Raw Normal View History

2023-11-17 08:45:00 +08:00
<script lang="ts" setup>
import { computed } from 'vue';
2023-12-14 21:45:29 +08:00
import { $t } from '@/locales';
2023-11-17 08:45:00 +08:00
defineOptions({ name: 'PinToggler' });
2023-12-14 21:45:29 +08:00
const props = defineProps<Props>();
2023-11-17 08:45:00 +08:00
interface Props {
pin?: boolean;
}
const icon = computed(() => (props.pin ? 'mdi-pin-off' : 'mdi-pin'));
</script>
<template>
<ButtonIcon
:tooltip-content="pin ? $t('icon.pin') : $t('icon.unpin')"
tooltip-placement="bottom-start"
trigger-parent
>
<SvgIcon :icon="icon" />
</ButtonIcon>
</template>
<style scoped></style>