ModalManager.vue 624 B

123456789101112131415161718192021222324252627282930
  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. }),
  21. ...mapState("modalVisibility", {
  22. activeModals: state => state.new.activeModals,
  23. modalMap: state => state.new.modalMap
  24. })
  25. }
  26. };
  27. </script>