vue project this. $router. go (- 1) can't goback

In the Vue project, hash route 'this. $router. go (- 1)' is used, and click button the url '#' before has a '?' & Causes the previous page to fail , double click It will take effect but url err

this origin url

http://localhost/payment/#/certification/detail

if i click goback the url change

http://localhost/payment/?#/certification/detail

 my code 

//button
<button class="btn back p-cu-p" @click="goback">GoBack</button>

//function
goback () {
this.$router.go(-1)
},
//route {
path:
'/certification', name: 'CertifictionIndex', component: () => import('@/views/CustomerManagement/certificationIndex.vue'), children: [ { path: '/', name: 'Certifiction', component: () => import('@/views/CustomerManagement/certification.vue'), }, { path: 'detail', name: 'CertifictionDetail', component: () => import('@/views/CustomerManagement/certificationDetail.vue'), }, ], }

 

posted @ 2021-06-04 11:25  AUSER  阅读(202)  评论(1)    收藏  举报