Skip to content
New issue

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

vue 3 - fix for 387 #424

Open
wants to merge 2 commits into
base: vue3-only
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions src/YMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default {
// if ymap isn't initialized or have no markers;
if (!window.ymaps
|| !ymaps.GeoObjectCollection
|| (!this.initWithoutMarkers && !this.$slots.default() && !this.placemarks.length)
|| (!this.initWithoutMarkers && !this.$slots.default && !this.placemarks.length)
) return;

this.$emit('map-initialization-started');
Expand Down Expand Up @@ -287,27 +287,39 @@ export default {
},
},
render() {
return h(
'section',
{
class: 'ymap-container',
ref: 'mapContainer',
},
[
h(
'div',
{
if (this.$slots.default) {
return h(
'section',
{
class: 'ymap-container',
ref: 'mapContainer',
},
[
h('div', {
id: this.ymapId,
class: this.ymapClass,
style: this.style,
},
),
this.isReady && h(
'div',
[this.$slots.default()],
),
],
);
}),
this.isReady && h('div', [this.$slots.default]),
]
);
} else {
return h(
'section',
{
class: 'ymap-container',
ref: 'mapContainer',
},
[
h('div', {
id: this.ymapId,
class: this.ymapClass,
style: this.style,
}),
this.isReady,
]
);
}
},
mounted() {
if (this.$attrs['map-link'] || this.$attrs.mapLink) throw new Error('Vue-yandex-maps: Attribute mapLink is not supported. Use settings.');
Expand Down