角色添加
<label>权限</label>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-tree class="m-role-tree m-width" ref="tree" :data="data" show-checkbox node-key="menuId" :default-expanded-keys="opendata" :props="defaultProps">
</el-tree>
export default {
data() {
return {
checkAll: false,
data: [],
opendata: [1],
defaultProps: {
children: 'children',
label: 'menuName'
},
}
},
mounted() {
this.getTree();
},
methods: {
handleCheckAllChange(val) {
if (this.checkAll) {