easy search implemented
This commit is contained in:
+32
-3
@@ -97,10 +97,11 @@
|
||||
<div class="om-header-container">
|
||||
<div class="om-header">
|
||||
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
||||
<form class="om-searchbar">
|
||||
<form class="om-searchbar" @submit.prevent="search()">
|
||||
<b-field>
|
||||
<b-input
|
||||
type="search"
|
||||
v-model="searchtext"
|
||||
icon="magnify"
|
||||
placeholder="Suche...">
|
||||
</b-input>
|
||||
@@ -183,11 +184,39 @@
|
||||
var app = new Vue({
|
||||
router,
|
||||
el: '#api',
|
||||
data: {
|
||||
data: function() {
|
||||
return{
|
||||
searchtext: "ipsum",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
search: function() {
|
||||
console.log("Searchtext: " +this.searchtext);
|
||||
$.ajax({
|
||||
url: "api/msg/search/" + this.searchtext,
|
||||
method: "GET"
|
||||
}).done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
_messagelist.splice(0, _messagelist.length);
|
||||
_messagelist.push.apply(_messagelist, jd);
|
||||
//console.log("jd: "+jd);
|
||||
for (var e in jd) {
|
||||
if (!_messages[jd[e]]) {
|
||||
get_insert_message(jd[e]);
|
||||
}
|
||||
}
|
||||
}).fail(function(e, f, g) {
|
||||
console.log("searching: err: " + e + f + g);
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
//this.search();
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
const search_data = [];
|
||||
/*
|
||||
export.default {
|
||||
|
||||
Reference in New Issue
Block a user