您好,欢迎来到小侦探旅游网。
搜索
您的当前位置:首页Vue页面跳转不用router-link的实现代码

Vue页面跳转不用router-link的实现代码

来源:小侦探旅游网
Vue页⾯跳转不⽤router-link的实现代码

1、给⽗页⾯跳转的地⽅设置事件

//原来的页⾯上展⽰的信息

//要跳转过去的页⾯⽤隐藏来代替

//v-model绑定formData.name(name为需要的字段,formDataw为表格ref绑定的数据)

确定

取消

2、JS部分

data() {

addShow: false //设置要显⽰的页⾯部分默认为false,隐藏 checkdDistributor: null, },

methods: { // 编辑按钮

handleEdit(index,row){

this.checkdDistributor = row; //接受传参

this.addShow = true; // addshow为要显⽰的页⾯ } }

watch: {

// 带参数编辑

checkdDistributor(){

for(let attr in this.formData){

this.formData[attr] = ('' + this.checkdDistributor[attr]); //写⼊参数 } } },

3、最后上效果图

补充:

vue router-link跳转传值⽰例1、router-link

2、routes路由

export default new Router({ routes: [ {

path: '/',

name: 'Index', component: Index }, {

path: '/deitail', name: 'deitail', component: deitail } ]})

3、取值

{{$route.params.freezeMon}}

4、⼩结:router-link跳转传值要注意的地⽅ * to前⾯要加:

* to后⾯{中的name值要与路由中的name值⼀致 * 下⾯的这种⽅式是错误的

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- xiaozhentang.com 版权所有 湘ICP备2023022495号-4

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务