vue项目中实现链接跳转有哪些方法,如何在新页面打开,下面web建站小编带大家了解一下实现代码!
// 直接写上跳转的地址
<router-link to="/index1">link跳转</router-link>
// 添加参数
<router-link :to="{path:'/index2', query:{id:1,name:'web'}}"></router-link>
// 新窗口打开
<router-link :to="{path:'/index3', query:{id:1,name:'web'}}" target="_blank"></router-link>
利用this.$router.replace跳转
toIndex (e) {
this.$router.replace({name: '/index', params: {id: e}})
}
利用this.$router.push跳转
toIndex (e) {
this.$router.push({name: "/index", params: {id: e}})
}
利用resolve跳转
toIndex (e) {
const new = this.$router.resolve({name: '/index', params: {id: e}})
window.open(new.href,'_blank')
}
上面是“vue项目中实现链接跳转几种方法(打开新页面)”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2904.html
workflows工作流
一幅生动而古怪的时尚鸭子插图ComfyUI工作流
斗鸡场威武雄鸡ComfyUI工作流
一个20岁丰满的女孩ComfyUI工作流
一只可爱的雪豹在雪地里散步ComfyUI工作流
严寒的冬天里一只小鸟在森林的树枝上休息
泰坦尼克号桌面壁纸上ComfyUI工作流
一座生动的点彩主义灯塔ComfyUI工作流
图生图生成动漫效果ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

用ascii字符画图像
SVG路径动画效果
数字滚动效果(兼容IE6/IE8)
纯css翻书效果
jquery鼠标滑过图片边框特效(jquery.focus-follow插件)
css3搭积木叠加图形
如何利用svg做一个有趣的loading动画加载









