Integrating Google Maps in vue.js

后端 未结 6 1234
情书的邮戳
情书的邮戳 2020-12-08 15:24

I\'ve been trying to initialize a Google map on my vue.js project while including the script :



        
6条回答
  •  庸人自扰
    2020-12-08 15:28

    Best and simple way to integrate Google Maps to Vue is use npm's libs. You need to use vue-google-maps

    npm install vue2-google-maps
    

    then,

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

    Just simple paste code below:

    
    
    
    
    

提交回复
热议问题