修复h5记事本不显示问题
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user