vue-google-maps
vue-google-maps copied to clipboard
Vue warnings when using polygon event listeners
When GMapPolygon has click or right click event handlers it works, but in the browser console I see a lot of Vue warnings like the following: [Vue warn]: Extraneous non-emits event listeners (click, rightclick) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option. at <GMapPolygon key="32b8f558-cbee-4680-bf93-b936fd68b6b4" paths= (45) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] options= {clickable: true, fillColor: '#7b95a2', fillOpacity: 0.25, strokeColor: '#7b95a2', strokeOpacity: 0.8, …} ... > at <Map key=0 ref="mapRef" class="map" ... > at <MapView zoom=4 center= {lat: 42.23854775620807, lng: 4.656360580576284} map-type-id="roadmap" ... > at <Map onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {__v_skip: true} > key=undefined > at <RouterView> at <QPageContainer> at <QLayout view="hHh lpR fFf" > at <AppLayout> at <App>
Yeah we have the same issue. We use the "dragend" Event and the vue warning is showing every time.
Same issue, hope there's some solution.
Having the same problem can get some events like "mouseup" to trigger and return an event, but it still throws the error:
[Vue warn]: Extraneous non-emits event listeners (mouseup) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.
But paths_changed doesn't emit anything and just throws the error
I have the same issue with @click event.
Same issue here with latest version 0.9.79
Finally got a workaround to fix this issue. In my case, I just need to remove the vite pre-bundling cache:
rm -rf node_modules/.vite
and then re-run the vite and it is back to work again.
The warnings make me crazy! Finally i find the way to resolve this issue. First, you need to modify "./node_modules/@fawmi/vue-google-maps/src/components/build_component.js" file and then remove the vite pre-bundling cache.
// modify "build-component.js"
return {
...(typeof GENERATE_DOC !== 'undefined' ? { $vgmOptions: options } : {}),
mixins: [MapElementMixin],
inheritAttrs: false, // add this property
props: {
...props,
...mappedPropsToVueProps(mappedProps),
},
// ....
}
# remove cache
rm -rf node_modules/.cache/vite
my version is 0.9.79