element ui在dialog对话框中使用tree组件,点击确定,通过`this.$refs.tree.getCheckedKeys()为什么获取不到值?该怎么解决?求大神!
报错:"TypeError: Cannot read property 'getCheckedKeys' of undefined"
<el-dialog title="分配角色" :visible.sync="showRoleTreeDialog">
<el-tree :data="roleTreeList" show-checkbox node-key="id" :props="{label: 'name'}"
:default-checked-keys="checkedRoleIds" style="border: 0">
</el-tree>
<div slot="footer" class="dialog-footer">
<el-button @click="showRoleTreeDialog = false">取 消</el-button>
<el-button type="primary" @click="doAuthorize">确 定</el-button>
</div>
</el-dialog>
相关分类