1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-22 10:38:28 +09:00
misskey/src/web/app/desktop/api/input.ts

20 lines
425 B
TypeScript
Raw Normal View History

2018-02-18 12:35:18 +09:00
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);
});
}