vue中的报错 The node before which the new node is to be inserted is not a child of this node.
The node before which the new node is to be inserted is not a child of this node.今天上线打完包在线上跑,点击element的下拉筛选框突然卡死,控制台报上面的错误vendors~app.f874c403.js:58 DOMException: Failed to execute 'insertBefore' on '
·
The node before which the new node is to be inserted is not a child of this node.
今天上线打完包在线上跑,点击element的下拉筛选框突然卡死,控制台报上面的错误
vendors~app.f874c403.js:58 DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
经资料查询发现,导致上述异常是因为在html中使用了v-if来控制局部显隐导致的。
解释:
页面用了v-if去控制dom元素,之后js操作了v-if控制的dom元素而导致的报错,可以用v-show,只是display:none元素,就不会抛出异常
更多推荐
已为社区贡献11条内容
所有评论(0)