与 onAdd/onRemove 方法挂钩

问题描述

使用 vue2-leaflet 我正在尝试创建一个自定义组件,但我找不到如何像在 leaflet JS tutorial 中那样实现 PXStringListAttribute.SetList<KNRWCSAttributeExt.usrSchemaField>(e.Cache,null,fields,fields); onAdd 方法

onRemove

传单中的真实 <template> <div>Some text displayed on the map.</div> </template> <script lang="ts"> import { Component,Mixins } from 'vue-property-decorator'; import { Map } from 'leaflet'; import { LControl } from 'vue2-leaflet'; @Component export default class MyControl extends Mixins(LControl) { onAdd(map: Map) { console.log('Never called'); } onRemove(map: Map) { console.log('Never called'); } } </script> 似乎存储在 L.Control 中,因此我找到了以下解决方法

this.mapObject

有没有更好的方法来做到这一点?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)