设置route
{
path:'/redirect/:path*',
component: () =>import('@/views/redirect/index'),
}
跳转页面页面内容
<script>
export default {
beforeCreate() {
const { params, query } = this.$route
const { path } = params
this.$router.replace({ path: '/' + path, query })
},
render: function(h) {
return h()
}
}
</script>
刷新方法
refresh() {
const { fullPath } = this.$route
this.$router.replace({
path: '/redirect' + fullPath
})
},
网友评论