在data里面设置变量
dialog: {
show: false,
title: "",
option: "",
},
html代码
//添加
<el-button type="primary" @click="addRoles">添加角色</el-button>
//编辑
<el-table-column label="操作" width="300px">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit" @click="eitRoles(scope.row)">编辑</el-button>
</template>
</el-table-column>
//模态框
<el-dialog :title="dialog.title" :visible.sync="dialog.show" width="30%">
<el-form
:model="ruleForm"
status-icon
:rules="from_rules"
ref