Vue.component('MsgCard', { template: `
{{ msg.subject }}
{{msg._id}}
{{ msg.message }}
#{{ tag }}

`, props: ['msg'], data: function () { return { isActive: false, }; }, methods: { myFilter: function(_messageid) { //var _messageid = $("#msgid").text(); var _bookmark = auth.bookmarks; _bookmark.push(_messageid); console.log("msgid"+_bookmark); var _userid = "5d360f06b8f3ce67d12ccc92"; this.isActive = !this.isActive; if(this.isActive){ $.ajax({ url: "api/usr", data: { userid: _userid, bookmark: _bookmark }, method: "PUT" }).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); } } }, filterForTag: function(tag) { console.log("link: " +tag); searching(tag); }, } });