Open joelr-cm opened 2 years ago
Hello guys,
I was wondering how to add a button and a click handler to it inside the suggestion item slot
vue-autosuggest
node
npm
yarn
Relevant code or config
<vue-autosuggest class="hello" :component-attr-id-autosuggest="'hey'" :suggestions="suggestions" :inputProps="inputProps" :sectionConfigs="sectionConfigs" :getSuggestionValue="getSuggestionValue" > <template slot-scope="{suggestion}"> <div v-if="suggestion.name == 'hotels'"> <img :class="{ avatar: true }" :src="suggestion.item.thumbnailUrl"/> {{suggestion.item.title}} </div> <div v-else> {{suggestion.item.name}} </div> <button @click="onDelete">delete</button> // <============= This click handler doesn't work </template>
Reproduction sandbox/repository: https://codesandbox.io/s/vueautosuggest-base-forked-ld3h4o?file=/App.vue
Problem description: I was wondering how to add a button and a click handler to it inside the suggestion item slot ? The click handler on the "delete" button in my sample code doesn't work
watch this https://github.com/darrenjennings/vue-autosuggest/issues/168#issuecomment-585015240
took me ages to find it
Hello guys,
I was wondering how to add a button and a click handler to it inside the suggestion item slot
vue-autosuggest
version: ^2.2.0node
version: v12.22.7npm
(oryarn
) version: 6.14.15Relevant code or config
Reproduction sandbox/repository: https://codesandbox.io/s/vueautosuggest-base-forked-ld3h4o?file=/App.vue
Problem description: I was wondering how to add a button and a click handler to it inside the suggestion item slot ? The click handler on the "delete" button in my sample code doesn't work