34 lines
542 B
Vue
Raw Normal View History

<script lang="ts" setup>
import { Expand, Fold } from "@element-plus/icons-vue"
2022-08-25 12:03:01 +08:00
const props = defineProps({
isActive: {
type: Boolean,
default: false
}
})
2022-08-23 11:39:01 +08:00
const emit = defineEmits<{
(e: "toggle-click"): void
}>()
const toggleClick = () => {
emit("toggle-click")
}
</script>
<template>
<div @click="toggleClick">
<el-icon :size="20" class="icon">
2022-08-25 12:03:01 +08:00
<Fold v-if="props.isActive" />
2022-08-23 11:39:01 +08:00
<Expand v-else />
</el-icon>
</div>
</template>
<style lang="scss" scoped>
.icon {
vertical-align: middle;
}
</style>