From e4b178a82bde1a082ad70d5134e0c6edd21a260c Mon Sep 17 00:00:00 2001 From: MouJieQin <724174637@qq.com> Date: Wed, 20 Nov 2024 00:01:09 +0800 Subject: [PATCH] Go to introduce section when open the detail page --- spa/src/views/VideoDetails.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/src/views/VideoDetails.vue b/spa/src/views/VideoDetails.vue index f91f9d1..e830810 100644 --- a/spa/src/views/VideoDetails.vue +++ b/spa/src/views/VideoDetails.vue @@ -778,6 +778,9 @@ export default { this.webpPath = res.webpPath this.videoInfo = res.videoInfo }, + goToIntroduce() { + document.getElementById("introduction").scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' }) + } }, async created() { await this.webSocketManager() @@ -785,6 +788,7 @@ export default { // await this.loadJson() await this.loadElements() document.title = this.videoInfo.title + this.goToIntroduce() }, async beforeUnmount() { this.isBeforeUnmount = true