前言:在ivew表格中任选一条数据,在操作栏中点击‘编辑’图标,这里我没有用在行间编辑的方式,而是跳转到新的编辑页面,那么就需要路由传参到新的页面显示
1.首先给‘编辑’按钮绑定点击事件
{
title: '操作',
key: 'action',
width: 150,
align: 'center',
render: (h, params) => {
return h('div', [
h('Icon', {
class: 'editHover',
props: {
type: 'md-create',
size: 15
},
attrs: {
title: '编辑'
},
on: {
click: () => {
this.handleEdit(params.row) //编辑方法
}
}
})
]);
}
}
2.然后在methods()中写这个方法: