whatsmode-nuxt-google-maps-module
v1.0.2
Published
NuxtJS module to import Google Maps for whatsmode
Downloads
8
Readme
Nuxt Google Maps Module
A NuxtJS module to import Google maps script
Table of Contents
Requirements
- npm
- NuxtJS
- NodeJS
Install
$ npm install --save nuxt-google-maps-module
Getting Started
Add nuxt-google-maps-module
to modules
section of nuxt.config.js
.
{
modules: [
// Simple usage
'nuxt-google-maps-module',
// With options
['nuxt-google-maps-module', {
/* module options */
key: 'GOOGLE MAPS KEY', // Default
}],
]
}
or even
{
modules: [
'nuxt-google-maps-module',
],
maps: {
key: 'GOOGLE MAPS KEY',
},
}
Usage
Once configured in nuxt.config.js
, you can use it in your components like:
{
...
mounted() {
const autocomplete = new this.$google.maps.places.Autocomplete(inputElement,
{
types: ['geocode'],
},
);
},
...
}