|
|
|
|
@ -1,23 +1,33 @@
|
|
|
|
|
<template>
|
|
|
|
|
<!-- 侧边栏通知容器组件 -->
|
|
|
|
|
<div class="sidebar-box">
|
|
|
|
|
<!-- 子标题组件:显示标题和图标,标题使用国际化键'titles.notice',图标为'notice' -->
|
|
|
|
|
<SubTitle :title="'titles.notice'" icon="notice" />
|
|
|
|
|
<div class="mx-auto">
|
|
|
|
|
<!-- 通知文本:小号字体,中等粗细,右对齐,应用notice样式类 -->
|
|
|
|
|
<span class="text-sm font-medium text-right notice"> {{ notice }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
// 导入Vue相关工具:计算属性、组件定义
|
|
|
|
|
import { computed, defineComponent } from 'vue'
|
|
|
|
|
// 导入子标题组件
|
|
|
|
|
import { SubTitle } from '@/components/Title'
|
|
|
|
|
// 导入应用状态存储
|
|
|
|
|
import { useAppStore } from '@/stores/app'
|
|
|
|
|
|
|
|
|
|
// 定义通知组件
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'Notice',
|
|
|
|
|
// 注册子组件
|
|
|
|
|
components: { SubTitle },
|
|
|
|
|
setup() {
|
|
|
|
|
// 获取应用状态实例
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
|
return {
|
|
|
|
|
// 计算属性:从应用配置中获取通知内容
|
|
|
|
|
notice: computed(() => {
|
|
|
|
|
return appStore.websiteConfig.notice
|
|
|
|
|
})
|
|
|
|
|
@ -27,8 +37,9 @@ export default defineComponent({
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
// 通知文本样式:自动换行,允许在单词内换行
|
|
|
|
|
.notice {
|
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</style>
|