鍍金池/ 問(wèn)答/HTML/ vue-router如何頁(yè)面跳轉(zhuǎn)時(shí)匿名傳參?

vue-router如何頁(yè)面跳轉(zhuǎn)時(shí)匿名傳參?

如題,不管是用params還是形入get請(qǐng)求的query在頁(yè)面跳轉(zhuǎn)的時(shí)候?yàn)g覽器地址欄都會(huì)顯示出完整的參數(shù)信息,那么如何做到帶參跳轉(zhuǎn)同時(shí)地址欄不顯示呢?

回答
編輯回答
編輯回答
陪我終

路由跳轉(zhuǎn)是可以帶參數(shù)的,默認(rèn)不顯示,顯示是因?yàn)槟鉹outer中做了配置

路由配置
{ path: '/slgl/zcfg', component: SlglZcfg,meta: {keepAlive: true}},

傳參
<router-link :to="{path:'/slgl/zcfg',query:{id:item.id,xwlx:item.xwlx}}">
    <span>{{item.xwbt}}</span>
</router-link>
2017年6月7日 16:50