-
Notifications
You must be signed in to change notification settings - Fork 475
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
Unknown custom element: <GmapMap> #437
Comments
Is it possible that the problem is coming from |
i Have the same problem : |
I got the same problem... Here is my customized component.
while in my main.js,
|
Try using the built-in GmapMap and GmapMarker components |
I ran into the same problem using a default Laravel 5.8 + Vue 2.6.10 installation. I think it might have something to do with a somewhat recent change in Vue to force non-camel-case elements (e.g. GmapMap is auto lowercased to gmapmap). Using the example here I was able to get this working by creating my own plugin facade in my app.js file like this:
and then continuing in my application files using the |
this method doesn't render the google map |
@bezblue ISSUE SOLVED after you done above step you can use the GmapMap in your component as follows
ISSUE SOLVED |
import Vue from 'vue';
import * as GmapVue from 'gmap-vue';
Vue.use(GmapVue, {
load: {
key: 'some-api-key',
libraries: 'places', // This is required if you use the Autocomplete plugin
},
installComponents: true,
});
Vue.component('google-maps-map', GmapVue.Map);
Vue.component('google-maps-marker', GmapVue.Marker); Now in my components I can use it as
|
[Vue warn]: Unknown custom element: <GmapMap> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
in main.js
// The Vue build version to load with the
import` command// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import store from '@/vuex/store'
import * as VueGoogleMaps from '@/main.js'
Vue.use(VueGoogleMaps, {
load: {
key: 'key'
}
})
Vue.use(Vuetify)
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
store,
el: '#app',
router,
components: { App },
template: ''
})
`
The text was updated successfully, but these errors were encountered: