From 2d90945991c450d81c2636aaa7b0df3a207b93ad Mon Sep 17 00:00:00 2001 From: Michael Labuschke Date: Thu, 4 Apr 2019 11:18:07 +0200 Subject: [PATCH 1/2] Add showAll option to show all data --- src/components/VueBootstrapTypeahead.vue | 8 +++++++- src/components/VueBootstrapTypeaheadList.vue | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/VueBootstrapTypeahead.vue b/src/components/VueBootstrapTypeahead.vue index ead6350..ad98886 100644 --- a/src/components/VueBootstrapTypeahead.vue +++ b/src/components/VueBootstrapTypeahead.vue @@ -33,6 +33,7 @@ :background-variant="backgroundVariant" :text-variant="textVariant" :minMatchingChars="minMatchingChars" + :showAll="showAll" @hit="handleHit" > @@ -93,7 +94,12 @@ export default { }, placeholder: String, prepend: String, - append: String + append: String, + showAll: { + type: Boolean, + default: false + }, + }, computed: { diff --git a/src/components/VueBootstrapTypeaheadList.vue b/src/components/VueBootstrapTypeaheadList.vue index f404987..d12dc69 100644 --- a/src/components/VueBootstrapTypeaheadList.vue +++ b/src/components/VueBootstrapTypeaheadList.vue @@ -56,7 +56,11 @@ export default { minMatchingChars: { type: Number, default: 2 + }, + showAll: { + type: Boolean } + }, computed: { @@ -81,7 +85,7 @@ export default { return [] } - const re = new RegExp(this.escapedQuery, 'gi') + const re = new RegExp(this.showall ? "" : this.escapedQuery, "gi"); // Filter, sort, and concat return this.data From 7e085478d4a66f4fe3a1380faf0a305382c95c3b Mon Sep 17 00:00:00 2001 From: Michael Labuschke Date: Thu, 4 Apr 2019 11:36:13 +0200 Subject: [PATCH 2/2] typo --- src/components/VueBootstrapTypeaheadList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VueBootstrapTypeaheadList.vue b/src/components/VueBootstrapTypeaheadList.vue index d12dc69..b4df700 100644 --- a/src/components/VueBootstrapTypeaheadList.vue +++ b/src/components/VueBootstrapTypeaheadList.vue @@ -85,7 +85,7 @@ export default { return [] } - const re = new RegExp(this.showall ? "" : this.escapedQuery, "gi"); + const re = new RegExp(this.showAll ? "" : this.escapedQuery, "gi"); // Filter, sort, and concat return this.data