Skip to content

Commit

Permalink
fix:修改tiptap
Browse files Browse the repository at this point in the history
  • Loading branch information
984507092 committed Nov 18, 2024
1 parent 62c74c7 commit f03e9e6
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions docs/view/learningNotes/12.tiptap基本教程.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,24 @@ export default {
// JSON
// const isSame = JSON.stringify(this.editor.getJSON()) === JSON.stringify(value)
// HTML
const isSame = this.editor.getHTML() === value
if (isSame) {
return
}
this.editor.commands.setContent(value, false, {
preserveWhitespace: 'full',
//处理回显时候的数据缩进
this.$nextTick(() => {
const isSame = this.editor.getHTML() === value
if (isSame) {
return
}
this.editor.commands.setContent(value, false, {
preserveWhitespace: 'full',
})
})
// const isSame = this.editor.getHTML() === value
// if (isSame) {
// return
// }
// this.editor.commands.setContent(value, false, {
// preserveWhitespace: 'full',
// })
},
},
},
Expand Down

0 comments on commit f03e9e6

Please sign in to comment.