|
|
|
|
|
|
|
|
<b-autocomplete |
|
|
<b-autocomplete |
|
|
rounded |
|
|
rounded |
|
|
v-model="searchtext" |
|
|
v-model="searchtext" |
|
|
:data="getFilteredTags" |
|
|
|
|
|
|
|
|
@keydown.native.enter="search" |
|
|
|
|
|
:data="filteredDataArray" |
|
|
placeholder="suche..." |
|
|
placeholder="suche..." |
|
|
icon="magnify" |
|
|
icon="magnify" |
|
|
@select="option => selected = option"> |
|
|
@select="option => selected = option"> |
|
|
|
|
|
|
|
|
el: '#api', |
|
|
el: '#api', |
|
|
data: function() { |
|
|
data: function() { |
|
|
return{ |
|
|
return{ |
|
|
searchtext: "ipsum", |
|
|
|
|
|
|
|
|
searchtext: "", |
|
|
selected: [], |
|
|
selected: [], |
|
|
taglist: dat, |
|
|
taglist: dat, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed:{ |
|
|
|
|
|
filteredDataArray() { |
|
|
|
|
|
return this.taglist.filter((option) => { |
|
|
|
|
|
return option |
|
|
|
|
|
.toString() |
|
|
|
|
|
.toLowerCase() |
|
|
|
|
|
.indexOf(this.searchtext.toLowerCase()) >= 0 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
search: function() { |
|
|
search: function() { |
|
|
console.log("Searchtext: " +this.searchtext + tagArray); |
|
|
|
|
|
|
|
|
console.log("Searchtext: " +this.searchtext.replace(/#/g,'')); |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "api/msg/search/" + this.searchtext, |
|
|
|
|
|
|
|
|
url: "api/msg/search/" + this.searchtext.replace(/#/g, ''), |
|
|
method: "GET" |
|
|
method: "GET" |
|
|
}).done(jd => { |
|
|
}).done(jd => { |
|
|
// NICHT SO wg. Vue: _messagelist = jd; |
|
|
// NICHT SO wg. Vue: _messagelist = jd; |
|
|
|
|
|
|
|
|
console.log("searching: err: " + e + f + g); |
|
|
console.log("searching: err: " + e + f + g); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getFilteredTags(text) { |
|
|
|
|
|
|
|
|
getFilteredTags(text) { |
|
|
this.taglist = dat.filter((option) => { |
|
|
this.taglist = dat.filter((option) => { |
|
|
return option |
|
|
return option |
|
|
.toString() |
|
|
.toString() |