This commit is contained in:
syuilo
2018-05-27 18:12:39 +09:00
parent e477de6dd0
commit fa1a85f682
6 changed files with 45 additions and 52 deletions

View File

@@ -1,16 +1,15 @@
import OS from '../../mios';
import Dialog from '../views/components/dialog.vue';
export default function(opts) {
export default (os: OS) => opts => {
return new Promise<string>((res, rej) => {
const o = opts || {};
const d = new Dialog({
propsData: {
title: o.title,
text: o.text,
modal: o.modal,
buttons: o.actions
}
}).$mount();
const d = os.new(Dialog, {
title: o.title,
text: o.text,
modal: o.modal,
buttons: o.actions
});
d.$once('clicked', id => {
res(id);
});