Skip to content

Commit

Permalink
linting of examples html and vue
Browse files Browse the repository at this point in the history
  • Loading branch information
xkjyeah committed Mar 11, 2017
1 parent 056e5c0 commit 19a9e61
Show file tree
Hide file tree
Showing 18 changed files with 1,279 additions and 1,249 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
examples/vue-google-maps.js
examples/dist/**
39 changes: 39 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,39 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
},
"globals": {
"google": false
},
"plugins": [
"html"
],
"settings": {
"html/html-extensions": [".html", ".vue"]
}
}
41 changes: 41 additions & 0 deletions examples/.eslintrc.json
@@ -0,0 +1,41 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
},
"globals": {
"google": false,
"Vue": false,
"VueGoogleMap": false
},
"plugins": [
"html"
],
"settings": {
"html/html-extensions": [".html", ".vue"]
}
}
140 changes: 70 additions & 70 deletions examples/basic-autocomplete.html
@@ -1,70 +1,70 @@
<body>
<div id="root">
<h1>Changing Default Place updates text box</h1>
<button @click="setDescription('Tokyo')">Set to Tokyo</button><br/>
<button @click="setDescription('Shanghai')">Set to Shanghai</button><br/>
<button @click="setDescription('Seoul')">Set to Seoul</button><br/>
<label>
Das Label
<gmap-autocomplete :value="description"
@place_changed="setPlace">
</gmap-autocomplete>
</label>
<br/>
{{latLng.lat}},
{{latLng.lng}}

<div>
<h2>Options work</h2>
You cannot find the state of Texas in this
<label>
Only locations in Singapore:
<gmap-autocomplete
:value="description"
@place_changed="setPlace"
:options="{
bounds: {north: 1.4, south: 1.2, east: 104, west: 102},
strictBounds: true
}">
</gmap-autocomplete>
</label>
</div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.js"></script>
<script src="vue-google-maps.js"></script>

<script>

Vue.use(VueGoogleMap, {
load: {
key: 'AIzaSyBzlLYISGjL_ovJwAehh6ydhB56fCCpPQw',
libraries: 'places'
},
});

document.addEventListener('DOMContentLoaded', function() {
new Vue({
el: '#root',
data: {
description: 'Singapore',
latLng: {}
},
methods: {
setDescription(description) {
this.description = description;
},
setPlace(place) {
this.latLng = {
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng(),
}
}
}
});
});

</script>

</body>
<body>
<div id="root">
<h1>Changing Default Place updates text box</h1>
<button @click="setDescription('Tokyo')">Set to Tokyo</button><br/>
<button @click="setDescription('Shanghai')">Set to Shanghai</button><br/>
<button @click="setDescription('Seoul')">Set to Seoul</button><br/>
<label>
Das Label
<gmap-autocomplete :value="description"
@place_changed="setPlace">
</gmap-autocomplete>
</label>
<br/>
{{latLng.lat}},
{{latLng.lng}}

<div>
<h2>Options work</h2>
You cannot find the state of Texas in this
<label>
Only locations in Singapore:
<gmap-autocomplete
:value="description"
@place_changed="setPlace"
:options="{
bounds: {north: 1.4, south: 1.2, east: 104, west: 102},
strictBounds: true
}">
</gmap-autocomplete>
</label>
</div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.js"></script>
<script src="vue-google-maps.js"></script>

<script>

Vue.use(VueGoogleMap, {
load: {
key: 'AIzaSyBzlLYISGjL_ovJwAehh6ydhB56fCCpPQw',
libraries: 'places'
},
});

document.addEventListener('DOMContentLoaded', function() {
new Vue({
el: '#root',
data: {
description: 'Singapore',
latLng: {}
},
methods: {
setDescription(description) {
this.description = description;
},
setPlace(place) {
this.latLng = {
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng(),
};
}
}
});
});

</script>

</body>

0 comments on commit 19a9e61

Please sign in to comment.