Compare commits
2 Commits
336a09f259
...
ef62875a57
Author | SHA1 | Date | |
---|---|---|---|
ef62875a57 | |||
4361812e62 |
@ -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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user