Cannot read properties of undefined (reading ‘setCheckedKeys‘)

this.$refs.tree.setCheckedKeys([3]);
报错Cannot read properties of undefined (reading ‘setCheckedKeys’)

这样写就没问题了

this.$nextTick(() => {
                        this.$refs.tree.setCheckedKeys(roads);
});

你可能感兴趣的:(element,element,elementui)