wip
This commit is contained in:
@@ -87,8 +87,26 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
// アプリ基底要素マウント
|
||||
document.body.innerHTML = '<div id="app"></div>';
|
||||
|
||||
const app = new Vue({
|
||||
router: new VueRouter({
|
||||
mode: 'history'
|
||||
}),
|
||||
created() {
|
||||
this.$watch('os.i', i => {
|
||||
// キャッシュ更新
|
||||
localStorage.setItem('me', JSON.stringify(i));
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
},
|
||||
render: createEl => createEl(App)
|
||||
});
|
||||
|
||||
os.app = app;
|
||||
|
||||
const launch = (api: (os: MiOS) => API) => {
|
||||
os.apis = api(os);
|
||||
|
||||
Vue.mixin({
|
||||
data() {
|
||||
return {
|
||||
@@ -99,20 +117,8 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
}
|
||||
});
|
||||
|
||||
const app = new Vue({
|
||||
router: new VueRouter({
|
||||
mode: 'history'
|
||||
}),
|
||||
created() {
|
||||
this.$watch('os.i', i => {
|
||||
// キャッシュ更新
|
||||
localStorage.setItem('me', JSON.stringify(i));
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
},
|
||||
render: createEl => createEl(App)
|
||||
}).$mount('#app');
|
||||
// マウント
|
||||
app.$mount('#app');
|
||||
|
||||
return [app, os] as [Vue, MiOS];
|
||||
};
|
||||
|
Reference in New Issue
Block a user