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" @typing="getAsyncData"
@select="(option) => (selected = option)" @select="(option) => (selected = option)"
> >
<template slot-scope="props"> <!-- <template slot-scope="props">-->
<div class="media"> <!-- <div class="media">-->
<div class="media-left"></div> <!-- <div class="media-left"></div>-->
<div class="media-content"> <!-- <div class="media-content">-->
{{ props.option.title }} <!-- {{ props.name }}-->
<br /> <!-- <br />-->
<small> <!-- <small>-->
Released at {{ props.option.release_date }}, rated <!-- Released at {{ props.option.release_date }}, rated-->
<b>{{ props.option.vote_average }}</b> <!-- <b>{{ props.option.vote_average }}</b>-->
</small> <!-- </small>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</template> <!-- </template>-->
</b-autocomplete> </b-autocomplete>
</b-field> </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>
<section class="map"> <section class="map">
<br /> <br />
@ -170,11 +185,11 @@ export default {
} }
this.isFetching = true this.isFetching = true
this.$axios this.$axios
.get(`https://demo.addok.xyz/search/?q=${name}`) .get(`https://demo.addok.xyz/search?&type=poi&q=${name}`)
.then(({ data }) => { .then(({ data }) => {
console.log('data', data) console.log('data', data)
this.data = [] this.data = []
data.results.forEach((item) => this.data.push(item)) data.features.forEach((item) => this.data.push(item))
}) })
.catch((error) => { .catch((error) => {
this.data = [] this.data = []