vue component 动态渲染组件时ref失效问题

动态引用组件如下:
image.png

如果这么去调用的时候会出现方法undefined
this.$refs.customcom.nodechange(data);

正确做法:获取到当前调用的ref的index,再去调用其方法
this.$refs.customcom[index].nodechange(data);

评论

暂无评论