yumechi-no-kuni/src/client/scripts/select-drive-file.ts

14 lines
336 B
TypeScript
Raw Normal View History

export function selectDriveFile($root: any, multiple) {
return new Promise((res, rej) => {
2020-04-22 05:36:28 -05:00
import('../components/drive-window.vue').then(m => m.default).then(dialog => {
const w = $root.new(dialog, {
type: 'file',
multiple
});
w.$once('selected', files => {
res(multiple ? files : files[0]);
});
});
});
}