om/public/routes/msgCard.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

Vue.component('MsgCard', {
template: `<div class="om-card card">
<h6 class="msg-head">
<b>{{ msg.subject }}</b>
<img src="favicon.ico" width=20px height=20px>
</h6>
2019-07-21 14:39:33 +02:00
{{ msg.message }}<br>
2019-07-19 12:52:43 +02:00
<a v-for="tag in msg.tag" @click="filterForTag(tag)">#{{ tag }} </a>
2019-07-21 14:39:33 +02:00
<br>
2019-07-02 13:08:11 +02:00
</p>
<div class="om-card-footer"> <div class="om-user-line">
<i class="material-icons">account_circle</i>
Erstellt von {{ msg.user }}</div>
<i class="material-icons" @click="myFilter()" v-if="!isActive">bookmark_border</i>
<i class="material-icons" @click="myFilter()" v-else="isActive">bookmark</i>
</div></div>`,
props: ['msg'],
data: function () {
return {
isActive: false,
};
},
methods: {
myFilter: function() {
this.isActive = !this.isActive;
},
2019-07-19 12:52:43 +02:00
filterForTag: function(tag) {
console.log("link: " +tag);
searching(tag);
},
}
});