2021-01-31 02:13:22 +08:00
|
|
|
|
<template>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
<div class="layout-navbars-breadcrumb-user-news">
|
|
|
|
|
<div class="head-box">
|
2021-04-01 11:13:38 +08:00
|
|
|
|
<div class="head-box-title">{{ $t('message.user.newTitle') }}</div>
|
|
|
|
|
<div class="head-box-btn" v-if="newsList.length > 0" @click="onAllReadClick">{{ $t('message.user.newBtn') }}</div>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="content-box">
|
|
|
|
|
<template v-if="newsList.length > 0">
|
|
|
|
|
<div class="content-box-item" v-for="(v, k) in newsList" :key="k">
|
|
|
|
|
<div>{{ v.label }}</div>
|
|
|
|
|
<div class="content-box-msg">
|
|
|
|
|
{{ v.value }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-box-time">{{ v.time }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2021-04-01 11:13:38 +08:00
|
|
|
|
<el-empty :description="$t('message.user.newDesc')" v-else></el-empty>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</div>
|
2021-04-01 11:13:38 +08:00
|
|
|
|
<div class="foot-box" @click="onGoToGiteeClick" v-if="newsList.length > 0">{{ $t('message.user.newGo') }}</div>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</div>
|
2021-01-31 02:13:22 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-03-15 12:44:58 +08:00
|
|
|
|
import { reactive, toRefs } from 'vue';
|
2021-01-31 02:13:22 +08:00
|
|
|
|
export default {
|
2021-03-15 12:44:58 +08:00
|
|
|
|
name: 'layoutBreadcrumbUserNews',
|
|
|
|
|
setup() {
|
|
|
|
|
const state = reactive({
|
|
|
|
|
newsList: [
|
|
|
|
|
{
|
|
|
|
|
label: '关于版本发布的通知',
|
|
|
|
|
value: 'vue-next-admin,基于 vue3 + CompositionAPI + typescript + vite + element plus,正式发布时间:2021年02月28日!',
|
|
|
|
|
time: '2020-12-08',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '关于学习交流的通知',
|
|
|
|
|
value: 'QQ群号码 665452019,欢迎小伙伴入群学习交流探讨!',
|
|
|
|
|
time: '2020-12-08',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
// 全部已读点击
|
|
|
|
|
const onAllReadClick = () => {
|
|
|
|
|
state.newsList = [];
|
|
|
|
|
};
|
|
|
|
|
// 前往通知中心点击
|
|
|
|
|
const onGoToGiteeClick = () => {
|
|
|
|
|
window.open('https://gitee.com/lyt-top/vue-next-admin');
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
onAllReadClick,
|
|
|
|
|
onGoToGiteeClick,
|
|
|
|
|
...toRefs(state),
|
|
|
|
|
};
|
|
|
|
|
},
|
2021-01-31 02:13:22 +08:00
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.layout-navbars-breadcrumb-user-news {
|
2021-03-15 12:44:58 +08:00
|
|
|
|
.head-box {
|
|
|
|
|
display: flex;
|
|
|
|
|
border-bottom: 1px solid #ebeef5;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
color: #333333;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
height: 35px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.head-box-btn {
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
&:hover {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.content-box {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
.content-box-item {
|
|
|
|
|
padding-top: 12px;
|
|
|
|
|
&:last-of-type {
|
|
|
|
|
padding-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
.content-box-msg {
|
|
|
|
|
color: #999999;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
}
|
|
|
|
|
.content-box-time {
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.foot-box {
|
|
|
|
|
height: 35px;
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border-top: 1px solid #ebeef5;
|
|
|
|
|
&:hover {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::v-deep(.el-empty__description p) {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
2021-01-31 02:13:22 +08:00
|
|
|
|
}
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</style>
|