mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
parent
a836e1c94c
commit
6b215cc8e8
1 changed files with 8 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
|||
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
|
||||
</div>
|
||||
<div class="_footer" v-if="$store.getters.isSignedIn && !announcement.isRead">
|
||||
<mk-button @click="read(announcement)" primary><fa :icon="faCheck"/> {{ $t('gotIt') }}</mk-button>
|
||||
<mk-button @click="read(items, announcement, i)" primary><fa :icon="faCheck"/> {{ $t('gotIt') }}</mk-button>
|
||||
</div>
|
||||
</section>
|
||||
</mk-pagination>
|
||||
|
@ -47,8 +47,13 @@ export default Vue.extend({
|
|||
},
|
||||
|
||||
methods: {
|
||||
read(announcement) {
|
||||
announcement.isRead = true;
|
||||
// TODO: これは実質的に親コンポーネントから子コンポーネントのプロパティを変更してるのでなんとかしたい
|
||||
read(items, announcement, i) {
|
||||
console.log(this);
|
||||
Vue.set(items, i, {
|
||||
...announcement,
|
||||
isRead: true,
|
||||
});
|
||||
this.$root.api('i/read-announcement', { announcementId: announcement.id });
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue