This commit is contained in:
syuilo
2018-02-17 18:14:23 +09:00
parent 283c64e6f1
commit 61b95e0c26
11 changed files with 179 additions and 121 deletions

View File

@@ -22,7 +22,9 @@ require('./common/views/components');
Vue.mixin({
destroyed(this: any) {
this.$el.parentNode.removeChild(this.$el);
if (this.$el.parentNode) {
this.$el.parentNode.removeChild(this.$el);
}
}
});
@@ -74,18 +76,38 @@ if (localStorage.getItem('should-refresh') == 'true') {
location.reload(true);
}
type API = {
chooseDriveFile: (opts: {
title: string;
currentFolder: any;
multiple: boolean;
}) => Promise<any>;
chooseDriveFolder: (opts: {
title: string;
currentFolder: any;
}) => Promise<any>;
};
// MiOSを初期化してコールバックする
export default (callback: (launch: () => Vue) => void, sw = false) => {
export default (callback: (launch: (api: API) => Vue) => void, sw = false) => {
const mios = new MiOS(sw);
Vue.mixin({
data: {
$os: mios
}
});
mios.init(() => {
// アプリ基底要素マウント
document.body.innerHTML = '<div id="app"></div>';
const launch = () => {
const launch = (api: API) => {
return new Vue({
data: {
os: mios
os: mios,
api: api
},
router: new VueRouter({
mode: 'history'