Demo:修复大纲中文本换行不生效,显示br标签的问题

This commit is contained in:
街角小林 2024-01-26 09:05:34 +08:00
parent 304e76e4af
commit edddbbd1d6
2 changed files with 4 additions and 4 deletions

View File

@ -131,11 +131,11 @@ export default {
let data = this.mindMap.getData()
data.root = true //
let walk = root => {
let text = (root.data.richText
let text = root.data.richText
? nodeRichTextToTextWithWrap(root.data.text)
: root.data.text
).replaceAll(/\n/g, '<br>')
text = htmlEscape(text)
text = text.replaceAll(/\n/g, '<br>')
root.textCache = text //
root.label = text
root.uid = root.data.uid

View File

@ -103,11 +103,11 @@ export default {
let data = this.mindMap.getData()
data.root = true //
let walk = root => {
let text = (root.data.richText
let text = root.data.richText
? nodeRichTextToTextWithWrap(root.data.text)
: root.data.text
).replaceAll(/\n/g, '<br>')
text = htmlEscape(text)
text = text.replaceAll(/\n/g, '<br>')
root.textCache = text //
root.label = text
root.uid = root.data.uid