您的位置: 首页 > 文章 > 使用iview实现某些组件时报错Failed to execute removeChild on Node 使用iview实现某些组件时报错Failed to execute removeChild on Node 分类: 文章 • 2024-08-15 14:21:40 完整错误 出现场景 在用iview实现tree组件实现编辑的功能时出现 添加子节点和修改子节点时报错 分析原因 报错位置,iview.js的这个函数 说明this.$el判断有问题 错误意思是删除一个node,但是它不是body的子node 解决办法 用document.body.contains改写函数,先来判断是不是body的子node,然后删除