mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-04-24 23:47:17 +08:00
34 lines
721 B
Vue
34 lines
721 B
Vue
<script setup lang="ts">
|
|
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 emit = defineEmits<{
|
|
(e: "toggleClick"): void;
|
|
}>();
|
|
|
|
const toggleClick = () => {
|
|
emit("toggleClick");
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
class="px-3 mr-1 navbar-bg-hover"
|
|
:title="props.isActive ? '点击折叠' : '点击展开'"
|
|
@click="toggleClick"
|
|
>
|
|
<IconifyIconOffline
|
|
:icon="props.isActive ? MenuFold : MenuUnfold"
|
|
class="inline-block align-middle hover:text-primary dark:hover:!text-white"
|
|
/>
|
|
</div>
|
|
</template>
|