1、路由跳转
// 跳转前页面
<router-link
v-if="scope.row.renewal"
class="text-button"
:to="{ name: 'customer-renewal-management', query: { position: positionMapping[scope.row.renewal.status] } }">
{{ scope.row.renewal.status | hyToText('renewalStatusText') }}
</router-link>
//跳转后页面
beforeRouteEnter (to, from, next) {
next(vm => {
const tabPosition = to.query.position || 1
const mapping = {
1: 'statusPending',
2: 'statusFail',
3: 'statusSuccess',
4: 'statusToBe'
}
vm.activeName = mapping[Number(tabPosition)]
})
},
网友评论