mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-27 04:26:44 -06:00
20 lines
386 B
TypeScript
20 lines
386 B
TypeScript
|
import Dialog from '../views/components/dialog.vue';
|
||
|
|
||
|
export default function(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();
|
||
|
d.$once('clicked', id => {
|
||
|
res(id);
|
||
|
});
|
||
|
document.body.appendChild(d.$el);
|
||
|
});
|
||
|
}
|