u
This commit is contained in:
1 parent
a4e59dd5d1
commit
c7240ea7c9
16 files changed
+598
-476
No files matched your search
@@ -1,15 +1,33 @@
|
||||
import ErrorModal from "./index.vue";
|
||||
|
||||
let isShowingErrorModal = false;
|
||||
let currentApp = null;
|
||||
|
||||
export const ErrorModalService = {
|
||||
show(responseData) {
|
||||
if (isShowingErrorModal && currentApp) {
|
||||
currentApp._instance.props.responseData = responseData;
|
||||
return;
|
||||
}
|
||||
|
||||
isShowingErrorModal = true;
|
||||
|
||||
const container = document.createElement("div");
|
||||
document.body.appendChild(container);
|
||||
|
||||
const app = createApp({
|
||||
data() {
|
||||
return {
|
||||
data: responseData,
|
||||
};
|
||||
},
|
||||
render() {
|
||||
return h(ErrorModal, {
|
||||
responseData: responseData,
|
||||
responseData: this.data,
|
||||
onClose: () => {
|
||||
isShowingErrorModal = false;
|
||||
currentApp = null;
|
||||
|
||||
app.unmount();
|
||||
document.body.removeChild(container);
|
||||
},
|
||||
@@ -17,6 +35,7 @@ export const ErrorModalService = {
|
||||
},
|
||||
});
|
||||
|
||||
currentApp = app;
|
||||
app.mount(container);
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user