Mobile wallpaper 1Mobile wallpaper 2Mobile wallpaper 3Mobile wallpaper 4Mobile wallpaper 5Mobile wallpaper 6
408 字
2 分钟
如何正确更新公告

一、公告位置配置:#

  1. 公告组件的内容不是在 sidebarLayoutConfig 中配置的,而是在 announcementConfig 对象中配置。一般情况不需要改变,下面是公告内容的详细配置示例:
  2. 名词解释:
    • type: “announcement”: 指定组件类型为公告组件,这是固定值。
    • enable: true: 控制该组件是否显示,true 为显示,false 为隐藏。
    • order: 2: 设置组件显示顺序,数值越小越靠前。通常公告组件设置为 2,显示在个人资料组件之后。
    • position: “top”: 设置组件在侧边栏内的定位方式,“top” 表示固定在顶部。
    • sidebar: “left”: 设置组件所属侧边栏,“left” 为左侧栏,“right” 为右侧栏(需配合 position: “both”)。
    • class: “onload-animation”: 组件的 CSS 类名,用于应用样式和动画效果。
    • animationDelay: 50: 组件加载动画的延迟时间(单位:毫秒),设置为 50 表示在个人资料组件后加载。

二、公告内容配置:#

  1. 概述:公告组件的内容不是在 sidebarLayoutConfig 中配置的,而是在 announcementConfig 对象中配置。 语法 :公告内容的详细配置示例:
    src/config.ts
    export const announcementConfig: AnnouncementConfig = {
    title: "Announcement", // 公告标题
    content: "Welcome to my blog! This is a sample announcement.", // 公告内容
    closable: true, // 允许用户关闭公告
    link: {
    enable: true, // 启用链接
    text: "Learn More", // 链接文本
    url: "/about/", // 链接 URL
    external: false, // 内部链接
    },
  2. 内容更改:
src/config.ts
export const announcementConfig: AnnouncementConfig = {
title: "网站公告",
content: "欢迎访问我的博客!这里会分享技术文章和生活感悟。",
closable: true,
link: {
enable: true,
text: "关于我",
url: "/about/",
external: false,
},
};
如何正确更新公告
https://docs.mizuki.mysqil.com/Sidepanel/announcement/
作者
QTY
发布于
2025-11-23
许可协议
CC BY 4.0

部分信息可能已经过时

封面
Sample Song
Sample Artist
封面
Sample Song
Sample Artist
0:00 / 0:00