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

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

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

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

},
mounted: function () {

Loading…
Cancel
Save