Search code examples
javascriptvue.jsgeolocation

Vue won't accept the colon in my code after options?


import * as VueGoogleMaps from 'vue2-google-maps'
Vue.use(VueGoogleMaps, options: {
  load: {
    key: ''
  },
  installComponents: false
}

Vue keeps telling me that the ":" after options is wrong and it expects a ",". I was following along to a tutorial about adding geolocating maps and I followed it exactly. It accepted his code, but won't take mine. Is there something wrong with the way I've set it up? I'm using Vue/Cli.


Solution

  • You don't need the label 'options'...pls check the modified code below

    import * as VueGoogleMaps from 'vue2-google-maps'
    Vue.use(VueGoogleMaps, {
      load: {
        key: ''
      },
      installComponents: false
    })
    

    To know more about vue2-google-maps please check the below link.. https://www.npmjs.com/package/vue2-google-maps