mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-27 06:46:44 -06:00
20 lines
425 B
TypeScript
20 lines
425 B
TypeScript
|
import InputDialog from '../views/components/input-dialog.vue';
|
||
|
|
||
|
export default function(opts) {
|
||
|
return new Promise<string>((res, rej) => {
|
||
|
const o = opts || {};
|
||
|
const d = new InputDialog({
|
||
|
propsData: {
|
||
|
title: o.title,
|
||
|
placeholder: o.placeholder,
|
||
|
default: o.default,
|
||
|
type: o.type || 'text'
|
||
|
}
|
||
|
}).$mount();
|
||
|
d.$once('done', text => {
|
||
|
res(text);
|
||
|
});
|
||
|
document.body.appendChild(d.$el);
|
||
|
});
|
||
|
}
|