Why ymaps.ready() not working?

Hello, the script
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&amp;apikey="some_api_key"></script>

loaded outside the context of the Vue to check the API is using ymaps.ready()
...
mounted() {
ymaps.ready({
 successCallback: () => {
this.yaMapInit()
}
})
},
...
methods: {
...
yaMapInit() {
 let id = this.forId

 try {
 this.SuggestView = new ymaps.SuggestView(id, {
 provider: { suggest: (...args) => this.suggest(...args) },
 boundedBy: this.bounds[this.brandCode],
 container: document.getElementById(id + '-container'),
 results: 50
})

 this.SuggestView.events.add('select', e => {
 this.geoValue = JSON.parse(e.get('item').jsonData).city
 localStorage.setItem('location.city', JSON.parse(e.get('item').jsonData).city)
})

 console.log('yamaps init')
 } catch (e) {
 console.log(`yamaps init error: ${e}`)
}
},
...
}


And every time when you first load the page I get init error
ymaps.SuggestView is not a constructor
What could be the problem?
April 7th 20 at 15:28
0 answer

Find more questions by tags Yandex.MapsVue.js