mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
41 lines
841 B
Vue
41 lines
841 B
Vue
<script setup lang="ts">
|
|
import { useI18n } from "vue-i18n";
|
|
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
|
|
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
|
|
|
|
interface Props {
|
|
isActive: boolean;
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
isActive: false
|
|
});
|
|
|
|
const { t } = useI18n();
|
|
|
|
const emit = defineEmits<{
|
|
(e: "toggleClick"): void;
|
|
}>();
|
|
|
|
const toggleClick = () => {
|
|
emit("toggleClick");
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
class="px-3 mr-1 navbar-bg-hover"
|
|
:title="
|
|
props.isActive
|
|
? t('buttons.pureClickCollapse')
|
|
: t('buttons.pureClickExpand')
|
|
"
|
|
@click="toggleClick"
|
|
>
|
|
<IconifyIconOffline
|
|
:icon="props.isActive ? MenuFold : MenuUnfold"
|
|
class="inline-block align-middle hover:text-primary dark:hover:!text-white"
|
|
/>
|
|
</div>
|
|
</template>
|