YaoYaoSidebarIcon.vue 811 B

1234567891011121314151617181920212223242526272829303132
  1. <script setup lang="ts">
  2. import { computed } from 'vue'
  3. import { NIcon } from 'naive-ui'
  4. import {
  5. AddOutline,
  6. ChatbubbleOutline,
  7. ConstructOutline,
  8. FolderOutline,
  9. GridOutline,
  10. PeopleOutline,
  11. SearchOutline,
  12. TimeOutline,
  13. } from '@vicons/ionicons5'
  14. type SidebarIconName = 'add' | 'board' | 'chat' | 'history' | 'folder' | 'people' | 'search' | 'tools'
  15. const props = withDefaults(defineProps<{ name: SidebarIconName; size?: number }>(), { size: 20 })
  16. const component = computed(() => ({
  17. add: AddOutline,
  18. board: GridOutline,
  19. chat: ChatbubbleOutline,
  20. history: TimeOutline,
  21. folder: FolderOutline,
  22. people: PeopleOutline,
  23. search: SearchOutline,
  24. tools: ConstructOutline,
  25. })[props.name])
  26. </script>
  27. <template>
  28. <NIcon :component="component" :size="size" aria-hidden="true" />
  29. </template>