修复h5记事本不显示问题

This commit is contained in:
2026-08-18 09:25:51 +08:00
parent aed71d237d
commit 0e797c39f4
11 changed files with 911 additions and 452 deletions
+9 -5
View File
@@ -49,6 +49,7 @@ import { ref, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getNote, createNote, updateNote, deleteNote } from '@/api/note.js'
import { formatDate } from '@/utils/date.js'
import { injectTableInlineStyles } from '@/utils/table-editor.js'
import NoteRichEditor from '@/components/NoteRichEditor.vue'
const noteId = ref('')
@@ -81,7 +82,7 @@ async function loadNote(id) {
return
}
form.title = note.title
form.content = note.content
form.content = injectTableInlineStyles(note.content || '')
form.pinned = !!note.pinned
meta.updatedAt = note.updatedAt
} catch (e) {
@@ -97,16 +98,17 @@ async function onSave() {
}
saving.value = true
try {
const formattedContent = injectTableInlineStyles(form.content)
if (noteId.value) {
await updateNote(noteId.value, {
title: form.title,
content: form.content,
content: formattedContent,
pinned: form.pinned
})
} else {
await createNote({
title: form.title,
content: form.content,
content: formattedContent,
pinned: form.pinned
})
}
@@ -191,14 +193,16 @@ function onDelete() {
padding: 24rpx 28rpx 0 28rpx;
overflow: hidden;
border-top: 1rpx solid $color-divider;
min-height: 520rpx;
}
.note-editor {
width: 100%;
flex: 1;
min-height: 0;
min-height: 440rpx;
box-sizing: border-box;
overflow: hidden;
display: flex;
flex-direction: column;
background: #f5f7fa;
border-radius: 12rpx;
padding: 20rpx;