diff --git a/packages/editor-ui/src/components/Modal.vue b/packages/editor-ui/src/components/Modal.vue index c8c6a6f0d4..84576db4bb 100644 --- a/packages/editor-ui/src/components/Modal.vue +++ b/packages/editor-ui/src/components/Modal.vue @@ -3,7 +3,7 @@ @@ -47,7 +47,7 @@ const sizeMap: {[size: string]: string} = { export default Vue.extend({ name: "Modal", - props: ['name', 'title', 'eventBus', 'size', 'drawer', 'drawerDirection', 'drawerWidth'], + props: ['name', 'title', 'eventBus', 'size', 'drawer', 'drawerDirection', 'drawerWidth', 'visible'], data() { return { visibleDrawer: this.drawer, @@ -85,13 +85,17 @@ export default Vue.extend({ this.$emit('enter'); } }, - closeDialog() { + closeDialog(done?: () => void) { this.$store.commit('ui/closeTopModal'); + if (done) { + done(); + } }, closeDrawer() { this.visibleDrawer = false; setTimeout(() =>{ this.$store.commit('ui/closeTopModal'); + this.visibleDrawer = true; }, 300); // delayed for closing animation to take effect }, }, diff --git a/packages/editor-ui/src/components/ModalRoot.vue b/packages/editor-ui/src/components/ModalRoot.vue index aeae24e2fb..287e086d7a 100644 --- a/packages/editor-ui/src/components/ModalRoot.vue +++ b/packages/editor-ui/src/components/ModalRoot.vue @@ -1,8 +1,8 @@ @@ -11,7 +11,7 @@ import Vue from "vue"; export default Vue.extend({ name: "ModalRoot", - props: ["name"], + props: ["name", "keepAlive"], methods: { isActive(name: string) { return this.$store.getters['ui/isModalActive'](name); diff --git a/packages/editor-ui/src/components/Modals.vue b/packages/editor-ui/src/components/Modals.vue index 5ace38c78a..2f0cf38f82 100644 --- a/packages/editor-ui/src/components/Modals.vue +++ b/packages/editor-ui/src/components/Modals.vue @@ -24,10 +24,11 @@ /> - -