Closed badspider7 closed 2 hours ago
你好,这个库很好用,提高了很多效率,给一大大的好评❤️。 但是有个问题我通过 initd这个事件拿到 map, BmapGL, instance ,这三个都没有看到有distory方法欸,想知道是直接拿到dom删掉就可以了吗,那一些事件也会同时注销掉吗。
因为我一个页面可能有多个实例这样子,不销毁的话内存占用有点大
组件内部是做了在组件卸载时的map实例销毁,你只需要控制好组件的卸载时机即可
ok,哈哈哈回复的好快
🤣刚好看到
刚刚看了下,也可以通过组件暴露出来的getMapInstance方法拿到map,然后调用map.distory()
是的,但这个api主要是给map组件下子元素使用的,正常使用不需要自己调用destroy
你好,这个库很好用,提高了很多效率,给一大大的好评❤️。 但是有个问题我通过 initd这个事件拿到 map, BmapGL, instance ,这三个都没有看到有distory方法欸,想知道是直接拿到dom删掉就可以了吗,那一些事件也会同时注销掉吗。