我就廢話不多說(shuō)了,大家還是直接看代碼吧~
1
2
3
4
5
6
7
|
<van-field label= "選擇部門(mén)" :value= "arr.DepartMentName" readonly right-icon= "arrow" @click= "$router.replace({ name: 'tree' })" /> |
在下個(gè)頁(yè)面使用replace跳回來(lái)即可
補(bǔ)充知識(shí):vue-router模式為history的項(xiàng)目打包發(fā)布后不能通過(guò)地址欄里的地址進(jìn)行路由跳轉(zhuǎn)
項(xiàng)目打包發(fā)布后不能通過(guò)地址欄里的地址進(jìn)行路由跳轉(zhuǎn),地址欄里回車(chē)訪問(wèn)就直接404
本項(xiàng)目使用nginx發(fā)布,所以這里只有nginx的配置方式。
修改nginx的配置文件
1
2
3
4
5
6
7
8
9
10
11
|
server { listen 8080; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { try_files $uri $uri/ /index.html; #必須要有的 root /home/dist/; #打包后的項(xiàng)目路徑,index.html所在文件夾 index index.html index.htm; } } |
以上這篇vue中路由跳轉(zhuǎn)不計(jì)入history的操作就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持服務(wù)器之家。
原文鏈接:https://blog.csdn.net/Qing_X_C/article/details/104674907