primevue-mirror/layouts/AppNews.vue

38 lines
1.1 KiB
Vue
Raw Normal View History

2022-04-07 12:57:53 +00:00
<template>
<div class="layout-news" :style="$appState.announcement.backgroundStyle">
<i></i>
<div class="layout-news-content">
<span class="layout-news-text" :style="$appState.announcement.textStyle">{{$appState.announcement.content}}</span>
2022-04-08 14:01:34 +00:00
<a class="layout-news-link" :href="$appState.announcement.linkHref">{{$appState.announcement.linkText}}</a>
2022-04-07 12:57:53 +00:00
</div>
2022-04-07 13:22:02 +00:00
<a class="layout-news-close" :style="$appState.announcement.textStyle" @click="onClose">
2022-04-07 12:57:53 +00:00
<span class="pi pi-times"></span>
</a>
</div>
</template>
<script>
2022-09-06 11:52:18 +00:00
import EventBus from './AppEventBus';
2022-04-07 12:57:53 +00:00
export default {
data() {
return {
storageKey: 'primevue',
hovered: false
}
},
mounted() {
EventBus.emit('news-activate');
},
methods: {
onClose() {
this.$appState.newsActive = false;
const item = {
hiddenNews: this.$appState.announcement.id
};
localStorage.setItem(this.storageKey, JSON.stringify(item));
}
}
}
2022-04-07 13:22:02 +00:00
</script>