diff --git a/src/views/post/index.scss b/src/views/post/index.scss index 603f30f..7f0c66b 100644 --- a/src/views/post/index.scss +++ b/src/views/post/index.scss @@ -148,7 +148,6 @@ .post-body { position: relative; width: 100%; - min-height: 300px; margin-top: -3em; padding: 2em; background-color: var(--bg-thin); @@ -277,6 +276,10 @@ } } + .post-main { + min-height: 300px; + } + .post-text { .post-title { font-size: 1.1rem; diff --git a/src/views/post/index.vue b/src/views/post/index.vue index ec446cc..341958b 100644 --- a/src/views/post/index.vue +++ b/src/views/post/index.vue @@ -33,6 +33,7 @@ export default { }, watch: { $route() { + this.clearAllData() this.getPostFn() this.generateRelatesFn() }, @@ -127,6 +128,13 @@ export default { break } }, + clearAllData() { + this.post = {} + this.relates = [] + this.toc = '' + this.content = '' + this.loading = true + }, handleClick(e) { const tocLinks = document.querySelectorAll('.toc-link') if (e.target.classList.contains('toc-link')) { @@ -159,7 +167,7 @@ export default {