mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-23 11:08:13 +09:00
21 lines
455 B
TypeScript
21 lines
455 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',
|
|
allowEmpty: o.allowEmpty
|
|
}
|
|
}).$mount();
|
|
d.$once('done', text => {
|
|
res(text);
|
|
});
|
|
document.body.appendChild(d.$el);
|
|
});
|
|
}
|