CommonSectionMenu.story.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import CommonSectionMenu from './CommonSectionMenu.vue'
  4. import CommonSectionMenuLink from './CommonSectionMenuLink.vue'
  5. const alert = window.alert?.bind(window)
  6. </script>
  7. <template>
  8. <Story>
  9. <Variant title="Default">
  10. <CommonSectionMenu
  11. :items="[
  12. {
  13. type: 'link',
  14. link: '/',
  15. icon: { name: 'mobile-all-tickets', size: 'base' },
  16. iconBg: 'bg-pink',
  17. label: 'Home',
  18. },
  19. {
  20. type: 'link',
  21. label: 'Action',
  22. onClick() {
  23. alert('click')
  24. },
  25. },
  26. ]"
  27. />
  28. </Variant>
  29. <Variant title="Action on click">
  30. <CommonSectionMenu
  31. header-label="Header"
  32. action-label="Click Me"
  33. :items="[
  34. {
  35. type: 'link',
  36. link: '/',
  37. icon: { name: 'mobile-all-tickets', size: 'base' },
  38. iconBg: 'bg-pink',
  39. label: 'Home',
  40. },
  41. ]"
  42. @action-click="alert('action clicked')"
  43. />
  44. </Variant>
  45. <Variant title="Slots">
  46. <CommonSectionMenu header-label="Header">
  47. <CommonSectionMenuLink label="Home" link="/" />
  48. <CommonSectionMenuLink
  49. label="Tickets"
  50. information="2"
  51. link="/tickets"
  52. />
  53. </CommonSectionMenu>
  54. </Variant>
  55. </Story>
  56. </template>