2018-12-06 10:23:38 +01:00
|
|
|
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>
|
|
|
|
{{ msg.message }}<br><br>
|
|
|
|
<a href="#">{{ msg.tag }}</a></p>
|
2018-12-18 09:20:13 +01:00
|
|
|
<div class="om-card-footer"> <div class="om-user-line">
|
2018-12-06 10:23:38 +01:00
|
|
|
<i class="material-icons">account_circle</i>
|
2018-12-18 09:20:13 +01:00
|
|
|
Erstellt von {{ msg.user }}</div>
|
2019-06-04 16:42:45 +02:00
|
|
|
|
|
|
|
<a href="#" v-if="isFavorited" @click.prevent="unFavorite(post)">
|
|
|
|
<i class="material-icons">bookmark_border</i></a>
|
|
|
|
|
|
|
|
<a href="#" v-else @click.prevent="favorite(post)">
|
|
|
|
<i class="bookmark"></i>
|
|
|
|
</a>
|
|
|
|
|
2018-12-06 10:23:38 +01:00
|
|
|
</div></div>`,
|
2019-06-04 16:42:45 +02:00
|
|
|
props: ['msg'],
|
|
|
|
// props: ['post', 'favorited'],
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
// isFavorited: '',
|
|
|
|
};
|
|
|
|
},
|
|
|
|
/* mounted() {
|
|
|
|
this.isFavorited = this.isFavorite ? true : false;
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isFavorite() {
|
|
|
|
return this.favorited;
|
|
|
|
},
|
|
|
|
},*/
|
|
|
|
methods: {
|
|
|
|
/* favorite(post) {
|
|
|
|
$.ajax({url: "api/ids", method: "POST"})
|
|
|
|
.then(response => this.isFavorited = true)
|
|
|
|
.catch(response => console.log(response.data));
|
|
|
|
},
|
|
|
|
unFavorite(post) {
|
|
|
|
$.ajax({url: "api/ids", method: "POST"})
|
|
|
|
.then(response => this.isFavorited = false)
|
|
|
|
.catch(response => console.log(response.data));
|
|
|
|
}*/
|
|
|
|
},
|
2018-12-06 10:23:38 +01:00
|
|
|
});
|