Skip to content

Instantly share code, notes, and snippets.

@mtermoul
Last active July 28, 2018 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtermoul/ee4924f7eac849f5dc4aead74ea5d82d to your computer and use it in GitHub Desktop.
Save mtermoul/ee4924f7eac849f5dc4aead74ea5d82d to your computer and use it in GitHub Desktop.
Main js to show how to initialize cosmic js data
import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import VueGoogleMaps from 'vue-googlemaps'
import 'vue-googlemaps/dist/vue-googlemaps.css'
import App from './App'
import router from './router'
import store from './store'
Vue.use(Vuetify)
Vue.use(VueGoogleMaps, {
load: {
// put your google API key either in the ./config/local.env.js file or just hardcode in the string below
apiKey: process.env.VUE_APP_GOOGLE_API_KEY || '',
libraries: ['places'],
useBetaRenderer: false
}
})
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>',
created () {
this.$store.dispatch('fetchMapIcons')
this.$store.dispatch('fetchCities')
this.$store.dispatch('fetchStoreCardImages')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment