Javascript

vue----router.go/push&location.href

本文主要是介绍vue----router.go/push&location.href,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

0. router.go/push介绍:

一句话,用来进行路径跳转的

1. 使用

router.go // 回到上一页首页

this.$router.go(-1) // 回到上一页首页

router.push // 普通的界面跳转(一般用于项目内的路径跳转)

this.$router.push('/')

location.href // 普通的路径跳转(一般用于项目外的路径跳转)

location.href = 'https://element.eleme.cn/'

这篇关于vue----router.go/push&location.href的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!