diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-10 14:56:33 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-10 14:56:33 +0900 |
| commit | 08ee9e4eaffa4b6809440ec2cbe4daad084c00df (patch) | |
| tree | e07b083068569ff26c8df29cbb949d29f5cbd648 /src/web/app/init.ts | |
| parent | wip (diff) | |
| download | sharkey-08ee9e4eaffa4b6809440ec2cbe4daad084c00df.tar.gz sharkey-08ee9e4eaffa4b6809440ec2cbe4daad084c00df.tar.bz2 sharkey-08ee9e4eaffa4b6809440ec2cbe4daad084c00df.zip | |
wip
Diffstat (limited to 'src/web/app/init.ts')
| -rw-r--r-- | src/web/app/init.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/web/app/init.ts b/src/web/app/init.ts index 91797a95ac..796a966940 100644 --- a/src/web/app/init.ts +++ b/src/web/app/init.ts @@ -61,22 +61,24 @@ if (localStorage.getItem('should-refresh') == 'true') { } // MiOSを初期化してコールバックする -export default (callback, sw = false) => { +export default (callback: (os: MiOS, launch: () => Vue) => void, sw = false) => { const mios = new MiOS(sw); mios.init(() => { // アプリ基底要素マウント document.body.innerHTML = '<div id="app"></div>'; - const app = new Vue({ - router: new VueRouter({ - mode: 'history' - }), - render: createEl => createEl(App) - }).$mount('#app'); + const launch = () => { + return new Vue({ + router: new VueRouter({ + mode: 'history' + }), + render: createEl => createEl(App) + }).$mount('#app'); + }; try { - callback(mios, app); + callback(mios, launch); } catch (e) { panic(e); } |