This commit is contained in:
wangting 2024-08-22 16:54:29 +08:00
parent cdbbc3a054
commit aee4bbbc81
2 changed files with 4 additions and 2 deletions

View File

@ -113,5 +113,7 @@ const router = createRouter({
history: createWebHistory(process.env.BASE_URL), history: createWebHistory(process.env.BASE_URL),
routes routes
}) })
router.afterEach(() => {
window.scrollTo(0,0);
})
export default router export default router

View File

@ -79,6 +79,7 @@
}, },
methods:{ methods:{
getData(id){ getData(id){
this.$router.push({path:'/article',query:{id:id}})
this.$http.post(`/door/getArt/${id}`).then(res=>{ this.$http.post(`/door/getArt/${id}`).then(res=>{
this.datObj = res.data.data this.datObj = res.data.data
this.datObj.content = this.datObj.content&&this.datObj.content.replace(/<img/g,'<img style="width:95%; height: auto;margin:0 auto"') this.datObj.content = this.datObj.content&&this.datObj.content.replace(/<img/g,'<img style="width:95%; height: auto;margin:0 auto"')
@ -106,7 +107,6 @@
}) })
}, },
goPage(){ goPage(){
if(this.menu.length!=0){ if(this.menu.length!=0){
let typeIndex = this.menu.findIndex(ele=>{ let typeIndex = this.menu.findIndex(ele=>{
return ele.name==this.datObj.category.categoryName return ele.name==this.datObj.category.categoryName