[Vuejs]-Vue.js integrate remote script with callback into vue into

0👍

You could create a Vue.js Map component.

First, make sure you have a main Vue instance for your app:

var myApp = new Vue({
  el: '#app',
})

Then you can create your map component:

Vue.component('map', {
    template: '#myMap',
    data: function () {
  data: {
    map: null;
  },
  methods: {
    initMap: function() {
      this.map = new google.maps.Map(document.getElementById('map'), {
        center: {lat: -34.397, lng: 150.644},
        zoom: 8
      });
    }
  }
})

Here is an example using Vue loader:
https://github.com/crabbly/vue-google-maps-example

If you want to use Vue loader (write components in one file):
https://github.com/vuejs/vue-loader

Leave a comment