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

[Feature] Loading #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion src/components/VueBootstrapTypeahead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
:text-variant="textVariant"
:maxMatches="maxMatches"
:minMatchingChars="minMatchingChars"
:loading="loading"
:loading-text="loadingText"
@hit="handleHit"
>
<!-- pass down all scoped slots -->
Expand Down Expand Up @@ -94,7 +96,15 @@ export default {
},
placeholder: String,
prepend: String,
append: String
append: String,
loading: {
type: Boolean,
default: false
},
loadingText: {
type: String,
default: 'Searching ...'
}
},

computed: {
Expand Down
13 changes: 13 additions & 0 deletions src/components/VueBootstrapTypeaheadList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<div class="list-group shadow">
<p class="vbst-item list-group-item list-group-item-action" v-if="loading">
<slot name="loading">
{{ loadingText }}
</slot>
</p>
<vue-bootstrap-typeahead-list-item
v-for="(item, id) in matchedItems" :key="id"
:data="item.data"
Expand Down Expand Up @@ -56,6 +61,14 @@ export default {
minMatchingChars: {
type: Number,
default: 2
},
loading: {
type: Boolean,
default: false
},
loadingText: {
type: String,
default: 'Searching ...'
}
},

Expand Down