first Try to autocomplete the search
This commit is contained in:
parent
d45ab87a8b
commit
5280c47477
@ -99,20 +99,18 @@
|
|||||||
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
||||||
<form class="om-searchbar" @submit.prevent="search()">
|
<form class="om-searchbar" @submit.prevent="search()">
|
||||||
<b-field>
|
<b-field>
|
||||||
<b-input
|
<b-taginput
|
||||||
type="search"
|
id="search-text"
|
||||||
v-model="searchtext"
|
type="search"
|
||||||
icon="magnify"
|
v-model="selected"
|
||||||
placeholder="Suche...">
|
:data=taglist
|
||||||
</b-input>
|
autocomplete
|
||||||
<!--<b-autocomplete
|
allow-new:true
|
||||||
v-model="name"
|
icon="magnify"
|
||||||
:data="filteredTagArray"
|
placeholder="suche.."
|
||||||
type="search"
|
@typing="getFilteredTags"
|
||||||
icon="magnify"
|
@input="saveTagsToArray">
|
||||||
placeholder="Suche..."
|
</b-taginput>
|
||||||
@blur="evaluate">
|
|
||||||
</b-autocomplete>-->
|
|
||||||
</b-field>
|
</b-field>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -169,6 +167,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
var tagArray = [];
|
||||||
|
const data=[
|
||||||
|
'th',
|
||||||
|
'efi',
|
||||||
|
'wichtig',
|
||||||
|
];
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{ path: "/", component: HomeRouter },
|
{ path: "/", component: HomeRouter },
|
||||||
@ -187,6 +191,8 @@
|
|||||||
data: function() {
|
data: function() {
|
||||||
return{
|
return{
|
||||||
searchtext: "ipsum",
|
searchtext: "ipsum",
|
||||||
|
selected: [],
|
||||||
|
taglist: data,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -208,7 +214,27 @@
|
|||||||
}).fail(function(e, f, g) {
|
}).fail(function(e, f, g) {
|
||||||
console.log("searching: err: " + e + f + g);
|
console.log("searching: err: " + e + f + g);
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
getFilteredTags(text) {
|
||||||
|
this.taglist = data.filter((option) => {
|
||||||
|
return option
|
||||||
|
.toString()
|
||||||
|
.toLowerCase()
|
||||||
|
.indexOf(text.toLowerCase()) >= 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveTagsToArray: function() {
|
||||||
|
tagArray = this.selected;
|
||||||
|
console.info(tagArray);
|
||||||
|
},
|
||||||
|
function get_insert_tag(id){
|
||||||
|
$.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
|
||||||
|
data.push("#"+tag.name);
|
||||||
|
console.log("it worked!");
|
||||||
|
}).fail(function (e, f, g) {
|
||||||
|
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
//this.search();
|
//this.search();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user