Fixed eslint errors

pull/62/head
Jef Roosens 2021-05-01 21:22:12 +02:00
parent 6532fbebb1
commit 1da94c5211
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 28 additions and 65 deletions

View File

@ -1,6 +1,8 @@
<template>
<Nav />
<router-view />
<div>
<Nav />
<router-view />
</div>
</template>
<script lang="ts">

View File

@ -1,51 +0,0 @@
<template>
<h1>Fej Frontend</h1>
<input id="street" type="text" placeholder="street" v-model="street" />
<button :onClick="onSubmit">Search</button>
<ul>
<li v-for="res in results">{{res.name}} ({{res.city}})</li>
</ul>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { Street, Ivago } from '../api/ivago'
export default defineComponent({
name: 'HelloWorld',
data () {
return {
street: '',
results: [] as Street[]
}
},
methods: {
onSubmit () {
new Ivago(import.meta.env.VITE_ENDPOINT as string).search(this.$data.street)
.then(res => {
this.$data.results = res
})
}
}
})
</script>
<style scoped>
a {
color: #42b983;
}
label {
margin: 0 0.5em;
font-weight: bold;
}
code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px;
color: #304455;
}
</style>

View File

@ -1,7 +1,9 @@
<template>
<h1>Fej</h1>
<p>Welcome to Fej, my frontend/backend combo.</p>
<p>If you can see this, the cicd worked!</p>
<div>
<h1>Fej</h1>
<p>Welcome to Fej, my frontend/backend combo.</p>
<p>If you can see this, the cicd worked!</p>
</div>
</template>
<script lang="ts">

View File

@ -1,17 +1,27 @@
<template>
<h1>Ivago</h1>
<input v-model="query" v-on:keyup.enter="search" type="text" placeholder="Street..." />
<div id="scroll-list">
<ul v-if="msg === ''">
<li v-for="item in items">{{ item.name }} ({{ item.city }})</li>
</ul>
<p v-else>{{ msg }}</p>
<div>
<h1>Ivago</h1>
<input
v-model="query"
v-on:keyup.enter="search"
type="text"
placeholder="Street..." />
<div id="scroll-list">
<ul v-if="msg === ''">
<li
v-for="item in items"
v-bind:key="`${item.name} (${item.city})`" >
{{ item.name }} ({{ item.city }})
</li>
</ul>
<p v-else>{{ msg }}</p>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { Street, search as ivago_search } from '../api/ivago'
import { Street, search as ivagoSearch } from '../api/ivago'
export default defineComponent({
name: 'Ivago',
@ -32,7 +42,7 @@ export default defineComponent({
return
}
ivago_search(this.query)
ivagoSearch(this.query)
.then((res: Street[]) => {
this.items = res
this.msg = ''