Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

#50-issue - Added a rawResults flag to VueBootstrapTypehead that enab… #54

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/VueBootstrapTypeahead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
:text-variant="textVariant"
:minMatchingChars="minMatchingChars"
@hit="handleHit"
:rawResults="rawResults"
>
<!-- pass down all scoped slots -->
<template v-for="(slot, slotName) in $scopedSlots" :slot="slotName" slot-scope="{ data, htmlText }">
Expand Down Expand Up @@ -93,7 +94,8 @@ export default {
},
placeholder: String,
prepend: String,
append: String
append: String,
rawResults: Boolean
},

computed: {
Expand Down
7 changes: 7 additions & 0 deletions src/components/VueBootstrapTypeaheadList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export default {
minMatchingChars: {
type: Number,
default: 2
},
rawResults: {
type: Boolean
}
},

Expand All @@ -77,6 +80,10 @@ export default {
},

matchedItems() {
if (this.rawResults) {
return this.data
}

if (this.query.length === 0 || this.query.length < this.minMatchingChars) {
return []
}
Expand Down