3.0.0
https://codesandbox.io/s/patient-dust-2q9bj?file=/src/components/Maps.vue
Point added
Numerous errors in the console: https://imgur.com/a/VElaZ4G
Sandbox link 2 version: https://codesandbox.io/s/charming-haibt-06w4x?file=/src/components/Maps.vue:0-1186
Sandbox link version 3: https://codesandbox.io/s/patient-dust-2q9bj?file=/src/components/Maps.vue
We use vue 3 versions for ionic, but due to compatibility problems we cannot finish our projects.
Open the issue on their repository not here
The library has been working for 5 years on all platforms, in all frameworks. View version 3 was updated and half of the libraries broke.
Vue 3 is a major version release. Major versions, by definition, come with breaking changes.
Libraries using Vue need to update to work with the new major version.
You can continue to use Vue 2 until you find that the libraries you need have done that.
Nobody will update their libraries in pure JS because you broke something there. You are losing a very large number of users. We need version 3 of the Vue because of ionic.
If it was a framework-specific library, then it would be a different matter. But this is a regular JS script.
But this is a regular JS script.
I missed that part as you mentioned a vue lib right after.
Took another look. this fixes it:
import { markRaw } from 'vue'
initializeYandexMap() {
ymaps.ready(() => {
const map = new ymaps.Map("yandex-map", {
center: [55.76, 37.64],
zoom: 10,
});
this. map = markRaw(map)
this.setMarkers();
});
},
in vue 3, anything you save on . You can opt out of the reacivity with this will be reactive by defaultmarkRaw(), which is sometimes necessary as reactivity can mess with stateful class instances like used here.
Edit:
A simpler solution is to remove map: null from data and by that, not make the object reactive in the first place.
We already recommend against making complex class instances reactive in Vue 2. It just so happens that is particular class only breaks now in Vue 3.
Thank you so much! It works!