This commit is contained in:
syuilo
2020-09-20 11:07:52 +09:00
parent 208343a3da
commit c50342a19e
4 changed files with 15 additions and 15 deletions

View File

@@ -54,20 +54,15 @@ export function popup(component: Component, props: Record<string, any>, events =
markRaw(component);
const id = Math.random().toString(); // TODO: uuidとか使う
const showing = ref(true);
const close = (...args) => {
resolve(...args);
showing.value = false;
};
const modal = {
type: 'popup',
component,
props,
showing,
events,
done: close,
bgClick: () => close(),
closed: () => {
store.commit('removePopup', id);
resolve();
},
id,
};
@@ -75,7 +70,7 @@ export function popup(component: Component, props: Record<string, any>, events =
onCancel.shouldReject = false;
onCancel(() => {
close();
showing.value = false;
});
});
}