<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" size="mini"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini"></el-button>
<el-tooltip effect="dark" content="分配角色" placement="top-start" :enterable="false">
<el-button type="warning" icon="el-icon-setting" size="mini" @click="setrole(scope.$index)"></el-button>
</el-tooltip>
</template>
</el-table-column>
setrole(index){
axios.get('http://localhost:3000/posts')
.then((res)=> {
this.activekey=index
this.userInfo=res.data[this.activekey]