const data=[
'#th',
'#efi',
'#wichtig',
];
const CreateMsgRouter = {
template: `
Neue Nachricht erstellen
ABBRECHEN
SENDEN
`,
data: function () {
return {
selected: [],
items: data
};
},
methods: {
createMsg: function () {
var subject = $("#subject").val();
var message = $("#message").val();
var tag = $("#tag").val();
var user = $("#user").val();
console.log("Message Created: " + tag + " " + message + " " + user);
$.ajax({
url: "api/createMsg",
data: {
sub: subject,
mess: message,
use: user,
ta: tag
},
method: "POST"
}).done(have_result).fail(have_error);
function have_result(res) {
console.log(res);
}
function have_error(err) {
console.log("error: " + err.responseText);
console.log(err);
}
},
getFilteredTags(text) {
this.items = data.filter((option) => {
return option
.toString()
.toLowerCase()
.indexOf(text.toLowerCase()) >= 0
})
},
},
mounted: function () {
if ($(this).bootstrapMaterialDesign)
$(this).bootstrapMaterialDesign();
},
};