From f267592e379cae7eb1b257ee8633ba3e60c1a636 Mon Sep 17 00:00:00 2001 From: Megghy Date: Tue, 22 Apr 2025 23:11:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20UpdateNoteContaine?= =?UTF-8?q?r=20=E7=BB=84=E4=BB=B6=E5=92=8C=20IndexView=20=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E5=A2=9E=E5=BC=BA=E5=8A=9F=E8=83=BD=E5=92=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 UpdateNoteContainer 组件中优化了内容渲染逻辑,简化了代码结构。 - 在 UpdateNote.ts 中新增版本 4 的更新记录,添加自动操作功能的详细说明。 - 在 IndexView 视图中引入新的图标,更新了功能列表,增强了用户界面。 - 改进了样式和布局,提升了整体视觉效果和用户交互体验。 --- src/components/UpdateNoteContainer.vue | 30 +- src/data/UpdateNote.ts | 24 ++ src/views/IndexView.vue | 516 ++++++++++++++++--------- src/views/manage/DashboardView.vue | 5 +- 4 files changed, 373 insertions(+), 202 deletions(-) diff --git a/src/components/UpdateNoteContainer.vue b/src/components/UpdateNoteContainer.vue index 5ac063d..e4ea875 100644 --- a/src/components/UpdateNoteContainer.vue +++ b/src/components/UpdateNoteContainer.vue @@ -3,20 +3,20 @@ import { updateNoteItemContentType, updateNotes } from '@/data/UpdateNote'; import { NDivider, NGrid } from 'naive-ui'; import { VNode } from 'vue'; - const currentVer = '1' - const savedVer = useStorage('UpdateNoteVer', 0) - function renderContent(content: updateNoteItemContentType): VNode | string | undefined { - if (Array.isArray(content)) { - return h('div', { style: { whiteSpace: 'pre-wrap' } }, content.map(item => renderContent(item))) - } - if (typeof content === 'string') { - return content - } - if (typeof content === 'function') { - return content() - } - return undefined; +function renderContent(content: updateNoteItemContentType): VNode | string | undefined { + if (Array.isArray(content)) { + return h('div', { style: { whiteSpace: 'pre-wrap' } }, content.map(item => renderContent(item))) } + const getContent = (c: unknown) => { + if (typeof c === 'string') { + return c + } + if (typeof c === 'function') { + return c() + } + } + return h('span', { style: { whiteSpace: 'pre-wrap' } }, getContent(content)) +}