index.vue 635 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <vab-icon class="fold-unfold" :icon="collapse ? unfold : fold" @click="toggleCollapse" />
  3. </template>
  4. <script lang="ts" setup>
  5. import { useSettingsStore } from '/@/store/modules/settings'
  6. defineOptions({
  7. name: 'VabFold',
  8. })
  9. defineProps({
  10. unfold: {
  11. type: String,
  12. default: 'menu-unfold-line',
  13. },
  14. fold: {
  15. type: String,
  16. default: 'menu-fold-line',
  17. },
  18. })
  19. const settingsStore = useSettingsStore()
  20. const { collapse } = storeToRefs(settingsStore)
  21. const { toggleCollapse } = settingsStore
  22. </script>
  23. <style lang="scss" scoped>
  24. .fold-unfold {
  25. color: var(--el-color-grey);
  26. cursor: pointer;
  27. }
  28. </style>