目录本项目页面之间跳转方式在template模板中添加在methods中写入路径修改路由文件Vue解决页面跳转问题解决办法本项目页面之间跳转方式 在template模板中添加 but
button按钮加入click事件
<el-button type="primary" @click="func()">添加试题</el-button>
func() {
this.$router.push({ path: "add-question" });
},
加入所有跳转的本地界面
问题描述:两个不同的页面,进行带参数跳转
1、需要跳转的页面,创建跳转方法。
//@click="PageJump(scope.row)"
//具体如下:
<el-table-column label="跳转页面" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="PageJump(scope.row)"
>点击跳转</el-button>
</template>
</el-table-column>
PageJump(row) {
this.$router.push({
path: "/页面/具体/路径/" + row.id,
params: {
id: row.id
}
});
}
2、配置路由(一般是router.js文件)
{
path: '/文件目录路径',
component: Layout,
hidden: true,
children: [
{
path: 'PageJump/data/:OtherId(\\d+)',
component: (resolve) => require(['@/views/跳转到的页面路径/index'], resolve),
name: 'PageJump',
meta: { title: '跳转到的页面', icon: '' }
}
]
}
按照这样基本可以完成带参数的页面跳转。
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。
--结束END--
本文标题: vue如何实现本项目页面之间跳转
本文链接: https://www.lsjlt.com/news/147009.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-12
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0