<el-table :data="userList" border stripe>
<el-table-column type="index" label="No." />
<!-- v-for="col in columnList" :prop="col.prop" :label="col.label" :key="col.prop" -->
<el-table-column label="姓名" prop="username">
<template slot-scope="">
<!-- <button type="text" v-model="scope.row.username"></el-button> -->
</template>
</el-table-column>
<el-table-column label="邮箱" prop="email">
<!-- <template slot-scope="scope">
<el-button type="text" v-model="scope.row.email"></el-button>
</template> -->
</el-table-column>
<el-table-column label="手机" prop="mobile">
<!-- <template slot-scope="scope">
<el-button type="text" v-model="scope.row.mobile"></el-button>
</template> -->
</el-table-column>
<el-table-column label="角色" prop="role_name">
<!-- <template slot-scope="scope">
<el-button type="text" v-model="scope.row.role_name"></el-button>
</template> -->
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<el-switch v-model="scope.row.mg_state" @change="userStateChanged(scope.row)"></el-switch>
</template>
</el-table-column>
但是switch那里可以获取到
无论是button还是el-button都是在标签内部填充内容的,而不是靠v-model绑定值