From aee4bbbc815f55f03dc00b315ba9d3b35df62f1d Mon Sep 17 00:00:00 2001 From: wangting <2940883238@qq.com> Date: Thu, 22 Aug 2024 16:54:29 +0800 Subject: [PATCH] xg --- src/router/index.js | 4 +++- src/views/pages/article.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index af8afd7..dc1888b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -113,5 +113,7 @@ const router = createRouter({ history: createWebHistory(process.env.BASE_URL), routes }) - +router.afterEach(() => { + window.scrollTo(0,0); +}) export default router diff --git a/src/views/pages/article.vue b/src/views/pages/article.vue index b908a06..fd83d0f 100644 --- a/src/views/pages/article.vue +++ b/src/views/pages/article.vue @@ -79,6 +79,7 @@ }, methods:{ getData(id){ + this.$router.push({path:'/article',query:{id:id}}) this.$http.post(`/door/getArt/${id}`).then(res=>{ this.datObj = res.data.data this.datObj.content = this.datObj.content&&this.datObj.content.replace(/{ return ele.name==this.datObj.category.categoryName