vue element 關(guān)閉當(dāng)前tab 跳轉(zhuǎn)到上一路由操作
方法一
this.$store.dispatch(’delVisitedViews’, this.$route);
this.$router.go(-1);
方法二
this.$store.state.tagsView.visitedViews.splice(this.$store.state.tagsView.visitedViews.findIndex(item => item.path === this.$route.path), 1)
this.$router.push(this.$store.state.tagsView.visitedViews[this.$store.state.tagsView.visitedViews.length-1].path)
補(bǔ)充知識(shí):vue+element解決點(diǎn)擊table列表的從詳情或修改頁面跳轉(zhuǎn)路由到列表頁總是跳轉(zhuǎn)到第一頁,而不能跳轉(zhuǎn)到當(dāng)前頁的問題
思路:
將當(dāng)前頁的頁碼currentPage存入session,然后點(diǎn)擊詳情跳轉(zhuǎn)到詳情頁面,然后,再次返回當(dāng)前頁的時(shí)候,在created生命周期里,獲取到存儲(chǔ)的currentPage,再進(jìn)行加載
以上這篇vue element 關(guān)閉當(dāng)前tab 跳轉(zhuǎn)到上一路由操作就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. 利用CSS3新特性創(chuàng)建透明邊框三角2. html清除浮動(dòng)的6種方法示例3. CSS代碼檢查工具stylelint的使用方法詳解4. Vue3使用JSX的方法實(shí)例(筆記自用)5. vue實(shí)現(xiàn)將自己網(wǎng)站(h5鏈接)分享到微信中形成小卡片的超詳細(xì)教程6. CSS3實(shí)例分享之多重背景的實(shí)現(xiàn)(Multiple backgrounds)7. 詳解CSS偽元素的妙用單標(biāo)簽之美8. 使用css實(shí)現(xiàn)全兼容tooltip提示框9. JavaScript數(shù)據(jù)類型對(duì)函數(shù)式編程的影響示例解析10. 不要在HTML中濫用div
