We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<template> <div id="map"> <yandexMap ref="myMap" :coords="DEFAULT_COORDS" class="full-width" :zoom="MAP_ZOOM" :scroll-zoom="false" @map-was-initialized="ready" > </yandexMap> </div> </template> <script> import { loadYmap } from 'vue-yandex-maps' export default { name: 'indexYandexMap', data: () => ({ API_KEY: 'мой ключ', DEFAULT_COORDS: [58.812924, 36.500804], MAP_ZOOM: 5, needToLoad: false }), created () { this.$axios .get(`https://api-maps.yandex.ru/2.1?lang=en_RU&apikey=${this.API_KEY}`) .then(() => { this.needToLoad = true }) .catch(() => { this.needToLoad = false }) }, async mounted () { await loadYmap({ apiKey: this.API_KEY }) }, methods: { ready () { const map = this.$refs.myMap.myMap map.controls.remove('rulerControl') map.controls.remove('geolocationControl') map.controls.remove('trafficControl') map.controls.remove('typeSelector') map.controls.remove('fullscreenControl') map.controls.remove('searchControl') } } } </script> <style scoped> </style>
В итоге получаю t.h is not a function. Как решать?
The text was updated successfully, but these errors were encountered:
Посмею предположить, что вы должны использовать аргумент метода "ready", вместо this.$refs
Sorry, something went wrong.
methods: { ready (map) { //const map = this.$refs.myMap.myMap map.controls.remove('rulerControl'); map.controls.remove('geolocationControl'); map.controls.remove('trafficControl'); map.controls.remove('typeSelector'); map.controls.remove('fullscreenControl'); map.controls.remove('searchControl'); } }
No branches or pull requests
В итоге получаю t.h is not a function. Как решать?
The text was updated successfully, but these errors were encountered: