CommonSectionPopup.story.vue 764 B

123456789101112131415161718192021222324252627282930313233
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { ref } from 'vue'
  4. import CommonSectionPopup from './CommonSectionPopup.vue'
  5. const state = ref(false)
  6. // eslint-disable-next-line no-alert
  7. const alert = (msg: string) => window.alert(msg)
  8. </script>
  9. <template>
  10. <Story>
  11. <Variant title="Default">
  12. <button @click="state = true">Open Popup</button>
  13. <CommonSectionPopup
  14. v-model:state="state"
  15. :items="[
  16. {
  17. label: 'Some Item',
  18. onAction() {
  19. alert('clicked!')
  20. },
  21. },
  22. {
  23. label: 'Some Link',
  24. link: '/',
  25. },
  26. ]"
  27. />
  28. </Variant>
  29. </Story>
  30. </template>