forked from xkjyeah/vue-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-place.html
41 lines (37 loc) · 1.13 KB
/
default-place.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<body>
<div id="root">
<h1>Test</h1> "Singapore" should appear in the text box on page load. No errors in console.
<gmap-place-input default-place="Singapore" @place_changed="updatePlace">
</gmap-place-input>
{{place && place.lat}}, {{place && place.lng}},
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.6/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.js"></script>
<script src="vue-google-maps.js"></script>
<script>
Vue.use(VueGoogleMaps, {
load: {
key: 'AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc',
libraries: 'places'
},
// Demonstrating how we can customize the name of the components
installComponents: true,
});
document.addEventListener('DOMContentLoaded', function() {
new Vue({
el: '#root',
data: {
place: null
},
methods: {
updatePlace(what) {
this.place = {
lat: what.geometry.location.lat(),
lng: what.geometry.location.lng()
};
}
}
});
});
</script>
</body>