Compare commits

...

2 Commits

Author SHA1 Message Date
ef62875a57 feat(search): proposal of choices 2020-12-17 22:27:12 +01:00
4361812e62 feat(search): search addok link ok 2020-12-17 22:14:19 +01:00

View File

@ -12,21 +12,36 @@
@typing="getAsyncData"
@select="(option) => (selected = option)"
>
<template slot-scope="props">
<div class="media">
<div class="media-left"></div>
<div class="media-content">
{{ props.option.title }}
<br />
<small>
Released at {{ props.option.release_date }}, rated
<b>{{ props.option.vote_average }}</b>
</small>
</div>
</div>
</template>
<!-- <template slot-scope="props">-->
<!-- <div class="media">-->
<!-- <div class="media-left"></div>-->
<!-- <div class="media-content">-->
<!-- {{ props.name }}-->
<!-- <br />-->
<!-- <small>-->
<!-- Released at {{ props.option.release_date }}, rated-->
<!-- <b>{{ props.option.vote_average }}</b>-->
<!-- </small>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
</b-autocomplete>
</b-field>
Résultats possibles: {{ data.length }}
<div v-if="data.length">
<ul>
<li v-for="item in data" :key="item.properties.id">
<div class="columns">
<div class="column">
{{ item.properties.name }}
</div>
<div class="column">
{{ item.properties.context }}
</div>
</div>
</li>
</ul>
</div>
</section>
<section class="map">
<br />
@ -170,11 +185,11 @@ export default {
}
this.isFetching = true
this.$axios
.get(`https://demo.addok.xyz/search/?q=${name}`)
.get(`https://demo.addok.xyz/search?&type=poi&q=${name}`)
.then(({ data }) => {
console.log('data', data)
this.data = []
data.results.forEach((item) => this.data.push(item))
data.features.forEach((item) => this.data.push(item))
})
.catch((error) => {
this.data = []