ModalManager.vue 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div>
  3. <div v-for="activeModalUuid in activeModals" :key="activeModalUuid">
  4. <component
  5. :is="this[modalMap[activeModalUuid]]"
  6. :modal-uuid="activeModalUuid"
  7. />
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import { mapState } from "vuex";
  13. import { mapModalComponents } from "@/vuex_helpers";
  14. export default {
  15. computed: {
  16. ...mapModalComponents("./components/modals", {
  17. editUser: "EditUser.vue",
  18. login: "Login.vue",
  19. register: "Register.vue",
  20. whatIsNew: "WhatIsNew.vue",
  21. createStation: "CreateStation.vue",
  22. editNews: "EditNews.vue",
  23. manageStation: "ManageStation/index.vue",
  24. importPlaylist: "ImportPlaylist.vue"
  25. }),
  26. ...mapState("modalVisibility", {
  27. activeModals: state => state.new.activeModals,
  28. modalMap: state => state.new.modalMap
  29. })
  30. }
  31. };
  32. </script>