1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-27 13:08:07 +09:00
hotomoe/src/web/app/desktop/api/choose-drive-file.ts
2018-02-18 12:35:18 +09:00

19 lines
445 B
TypeScript

import MkChooseFileFromDriveWindow from '../views/components/choose-file-from-drive-window.vue';
export default function(opts) {
return new Promise((res, rej) => {
const o = opts || {};
const w = new MkChooseFileFromDriveWindow({
propsData: {
title: o.title,
multiple: o.multiple,
initFolder: o.currentFolder
}
}).$mount();
w.$once('selected', file => {
res(file);
});
document.body.appendChild(w.$el);
});
}