allow thumbnail in autocomplete filter type
This commit is contained in:
parent
2d16629b9e
commit
c2fdca0f9d
|
@ -10,6 +10,16 @@
|
|||
:loading="loading"
|
||||
field="label"
|
||||
@select="option => setResults(option) ">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div class="media-left" v-if="props.option.img">
|
||||
<img width="32" :src="`${props.option.img}`">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.label }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</b-autocomplete>
|
||||
<br>
|
||||
<div class="field has-text-centered">
|
||||
|
@ -137,4 +147,15 @@
|
|||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<style scoped>
|
||||
#profileImage {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
font-size: 35px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 150px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
|
@ -34,7 +34,7 @@ export const filter_type_mixin = {
|
|||
.then(res => {
|
||||
if (res.data.length > 0) {
|
||||
for (let item of res.data) {
|
||||
this.options.push({label: item.title, value: item.id, img: ''});
|
||||
this.options.push({label: item.title, value: item.id, img: item.featured_image });
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue