feat: 更新 UpdateNoteContainer 组件和 IndexView 视图,增强功能和用户体验

- 在 UpdateNoteContainer 组件中优化了内容渲染逻辑,简化了代码结构。
- 在 UpdateNote.ts 中新增版本 4 的更新记录,添加自动操作功能的详细说明。
- 在 IndexView 视图中引入新的图标,更新了功能列表,增强了用户界面。
- 改进了样式和布局,提升了整体视觉效果和用户交互体验。
This commit is contained in:
2025-04-22 23:11:32 +08:00
parent dd29a141de
commit f267592e37
4 changed files with 373 additions and 202 deletions

View File

@@ -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))
}
</script>
<template>
@@ -32,9 +32,7 @@ import { VNode } from 'vue';
<NDivider title-placement="left">
{{ item.date }}
</NDivider>
<NGrid
x-gap="10"
>
<NGrid x-gap="10">
<template
v-for="note in item.items"
:key="note.title"