Skip to content

Commit

Permalink
fix: footer page view not update on load
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyxguo committed Aug 12, 2023
1 parent 3a23cb2 commit 909c191
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ coverage
/dist
/source
/layout
layout/index.ejs


.pnp.*
Expand Down
11 changes: 6 additions & 5 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</template>

<script lang="ts">
import { computed, defineComponent, watch } from 'vue'
import { computed, defineComponent, nextTick, watch } from 'vue'
import { useAppStore } from '@/stores/app'
import { useI18n } from 'vue-i18n'
import SvgIcon, { SvgTypes } from '@/components/SvgIcon/index.vue'
Expand All @@ -134,10 +134,11 @@ export default defineComponent({
useCommentPlugin()
watch(
() => enabledCommentPlugin.value.plugin,
(newValue, oldValue) => {
if (oldValue === '' && newValue) {
window.setTimeout(() => intiCommentPluginPageView('/'), 50)
() => appStore.configReady,
async (newValue, oldValue) => {
if (!oldValue && newValue) {
await nextTick()
intiCommentPluginPageView('/')
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function convertToLocale(label: string) {
}

export function cleanPath(path: string) {
if (path.at(-1) === '/') {
if (path !== '/' && path.at(-1) === '/') {
return path.slice(0, -1)
}

Expand Down

0 comments on commit 909c191

Please sign in to comment.