yandex-maps-unofficial / vue-yandex-map

Yandex Maps Component for VueJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Events not work on fresh map install Nuxt3

shirowayfy opened this issue · comments

Trying to access map instance, but code do nothing

<template>
  <YandexMap ref="map" :settings="settings" :coordinates="[55.751244, 37.618423]" :controls="[]" :options="options"
             @click="onClick" :zoom.sync="zoom"
             @map-was-initialized="initHandler"
  />
</template>

<script setup>
import {YandexMap} from 'vue-yandex-maps'

const config = useRuntimeConfig()

const settings = ref({
  apiKey: config.public.YANDEX_API_KEY,
  lang: 'ru_RU',
  coordorder: 'latlong',
  debug: false,
  version: '2.1',
})

const options = {
  suppressMapOpenBlock: true
}

const initHandler = () => {
  console.log('init')
}

const onClick = () => {
  hideSearchPanel()
}

const zoom = useState('mapZoom', () => 12)
</script>

<style lang="scss" scoped>
.yandex-container {
  width: 100%;
  height: 100%;
}
</style>

My bad, docs for beta got work