|
export default {
name: 'test',
data() {
return {
pois: []
}
},
apiready() {
this.getPois();
},
methods: {
getPois() {
var map = api.require('bMap');
map.getLocation({
accuracy: '100m',
autoStop: true,
filter: 1
}, function(ret, err) {
if (ret.status) {
console.log(JSON.stringify(ret));
this.data.pois = ret.results;
}
});
},
}
}
</script>
这样写就返回错误:
[ERROR] dispatch script failed. TypeError: Cannot set property 'pois' of undefined |
|