lundi 24 août 2020

Cannot include script for google autocomplete in vue.js using laravel

I'm using vue.js and implementing google autocomplete in the head section i'm trying to include this script app.blade.php :

<head>
 <script src="https://maps.googleapis.com/maps/api/js?key=&libraries=places" defer></script>
</head> 

but when i load my component this script is not found and i'm getting error

VM2823 app.js:62045 [Vue warn]: Error in mounted hook:
"ReferenceError: google is not defined"
     
    found in
     
    ---> <VueGoogleAutocomplete> at node_modules/vue-google-autocomplete/src/VueGoogleAutocomplete.vue
           <user> at resources/js/components/addUser.vue
             <Root>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire