【发布时间】:2019-05-12 18:50:25
【问题描述】:
我正在用 Vue.js 和 Leaflet 制作一个应用程序。 在这个应用程序中,我在使用 L.DomUtil 创建的传单中选择了一个
this.select = L.DomUtil.create('select','leaflet-countryselect',this.div);
我没有找到在这个“选择”中放置“v-on:change”的方法,所以我必须在 Vue.js 的函数方法中调用一个事件函数。
methods: {
firstFunction{
},
secondFunction() {
this.select.on('change', function(e){
this.firstFunction()
}
}
}
但它不起作用,错误是“this.firstFunction() is not a function”
我试着放了
.../
var _self = this
_self.firstFunction()
../
但无论如何都不起作用。
我该怎么做?谢谢。
【问题讨论】:
标签: javascript vue.js vuejs2 leaflet vue-component