From 53f018aae68bed866ad1bd34cd6aa1c6dc857464 Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Sat, 1 Feb 2020 09:12:04 +0900 Subject: [PATCH] Fix bug --- src/client/pages/index.home.vue | 9 ++++++++- src/client/pages/index.vue | 16 +++++++++++++++- src/client/router.ts | 10 +++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/client/pages/index.home.vue b/src/client/pages/index.home.vue index 0c3d2e7f86..4801035293 100644 --- a/src/client/pages/index.home.vue +++ b/src/client/pages/index.home.vue @@ -1,6 +1,6 @@ <template> <div class="mk-home" v-hotkey.global="keymap"> - <portal to="header"> + <portal to="header" v-if="showTitle"> <button @click="choose" class="_button _kjvfvyph_"> <i><fa v-if="$store.state.i.hasUnreadAntenna" :icon="faCircle"/></i> <fa v-if="src === 'home'" :icon="faHome"/> @@ -35,6 +35,13 @@ export default Vue.extend({ XTimeline }, + props: { + showTitle: { + type: Boolean, + required: true + } + }, + data() { return { src: 'home', diff --git a/src/client/pages/index.vue b/src/client/pages/index.vue index 18c8945b65..788df3929a 100644 --- a/src/client/pages/index.vue +++ b/src/client/pages/index.vue @@ -1,5 +1,5 @@ <template> -<component :is="$store.getters.isSignedIn ? 'home' : 'welcome'"></component> +<component :is="$store.getters.isSignedIn ? 'home' : 'welcome'" :show-title="showTitle"></component> </template> <script lang="ts"> @@ -12,6 +12,20 @@ export default Vue.extend({ components: { Home, Welcome: () => import('./index.welcome.vue').then(m => m.default), + }, + + data() { + return { + showTitle: true, + } + }, + + activated() { + this.showTitle = true; + }, + + deactivated() { + this.showTitle = false; } }); </script> diff --git a/src/client/router.ts b/src/client/router.ts index 7eb12c8e44..9c028e9edc 100644 --- a/src/client/router.ts +++ b/src/client/router.ts @@ -49,5 +49,13 @@ export const router = new VueRouter({ { path: '/auth/:token', component: () => import('./pages/auth.vue').then(m => m.default) }, { path: '/authorize-follow', component: () => import('./pages/follow.vue').then(m => m.default) }, /*{ path: '*', component: MkNotFound }*/ - ] + ], + /* なんかバギー + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition; + } else { + return { x: 0, y: 0 }; + } + }*/ });