Closed devmansurov closed 2 years ago
I'll see it later. Thanx
I'll see it later. Thanx
I get answer from stackoverflow:
vue-yandex-maps renders a map container with a randomly generated ID that is passed to the ymaps.Map constructor, which later uses it to query the document for the element. Unfortunately, the map container is rendered inside the Shadow DOM of the app-root custom element, which is hidden from document queries. The document.querySelector() thus returns null, and the ymaps.Map code tries to get the size of the container via the null reference, leading to the error you observed.
You would have to patch vue-yandex-maps yourself, or submit a GitHub issue to request a feature change, where you could pass in the map container element (from the custom element's Shadow DOM) instead of an ID. It looks like ymaps.Map already accepts either an element or a string ID, so no other change would be necessary.
Can you say something given this answer from the stackoverflow?
I have 2 projects with vue yandex map in vue 3:
In this project I connected plugin like this:
In this project plugin connected like this:
You can see more details going by project link or in stackoverflow