Browse Source

Clear-Funktion bei der Suche

master
Xenia Gruenzinger 5 years ago
parent
commit
f4ab8813f3
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      public/index.html

+ 15
- 3
public/index.html View File

<form class="om-searchbar" @submit.prevent="search()"> <form class="om-searchbar" @submit.prevent="search()">
<b-field> <b-field>
<b-autocomplete <b-autocomplete
id="searchtext"
rounded rounded
v-model="searchtext" v-model="searchtext"
@keydown.native.enter="search" @keydown.native.enter="search"
@typing="getFilteredTags" @typing="getFilteredTags"
@input="saveTagsToArray"> @input="saveTagsToArray">
</b-taginput>--> </b-taginput>-->
<button @click="clear">x</button>
</b-field> </b-field>
</form> </form>
</div> </div>
router, router,
el: '#api', el: '#api',
data: function() { data: function() {
return{
return {
searchtext: "", searchtext: "",
isSearchActiv: false,
selected: [], selected: [],
taglist: dat, taglist: dat,
}; };
}, },
methods: { methods: {
search: function() { search: function() {
this.isSearchActiv = true;
console.log("Searchtext: " +this.searchtext.replace(/#/g,'')); console.log("Searchtext: " +this.searchtext.replace(/#/g,''));
$.ajax({ $.ajax({
url: "api/msg/search/" + this.searchtext.replace(/#/g, ''), url: "api/msg/search/" + this.searchtext.replace(/#/g, ''),
} }
}).fail(function (e, f, g) { }).fail(function (e, f, g) {
console.log("err: " + e + f + g); console.log("err: " + e + f + g);
});
}
});
},

clear: function() {
console.log("clear");

this.isSearchActiv = false;
this.searchtext = "";
listMessages();
},


}, },
mounted: function () { mounted: function () {

Loading…
Cancel
Save