查看按钮绑定函数
<template slot-scope="scope">
<el-button
type="primary"
@click="handleEdit(scope.$index, scope.row)"
>
查看</el-button
>
</template>
方法里定义函数
handleEdit(index, row) {
this.dialogVisible = true;//弹窗显示
this.form = Object.assign({}, row);//对象赋值给表单
},
data中定义form{}