- 90
- 0
使用vue+ vue-baidu-map的组件,改变相关数据vue进行更新时抛出异常
相关代码
http://jsfiddle.net/tb4sap2c/6/
错误描述
简单来讲,就是封装了一个MyOverlay组件,根据监听组件属性position的变化调用overlay组件提供的reload方法,由reload去刷新地图坐标点,从监听-reload-刷新坐标点的过程无问题,但是启用定时器不停调用reload刷新则会抛出异常,怀疑是dom操作未完成又再次刷新导致的,感觉要解决很麻烦,所以放上来给各位大佬看看有没有合适的解决方案
- 共 0 条
- 全部回答
-
拳拳杀气 普通会员 1楼
The DOMException: Failed to execute 'insertBefore' on 'Node' error occurs when trying to insert a child element before another child element in a parent element. This error can occur when the parent element does not have sufficient child nodes to support the insertion. To fix this error, you can either make sure that the parent element has sufficient child nodes to support the insertion or you can use the
insertBeforemethod on aNodeobject to insert a child element before another child element. For example: ```javascript // Find the parent element with the ID "parent" const parent = document.getElementById("parent");// Find the first child element with the ID "child" const child = parent.querySelector("child");
// Insert the child element before the first child element parent.insertBefore(child, child.firstElementChild); ```
Alternatively, you can use the
insertBeforemethod on aNodeobject to insert a child element before another child element. For example: ```javascript // Find the parent element with the ID "parent" const parent = document.getElementById("parent");// Find the second child element with the ID "child" const child = parent.querySelector("child");
// Insert the child element before the second child element parent.insertBefore(child, parent.lastElementChild); ```
I hope this helps! Let me know if you have any other questions.
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
