Demo:修复大纲中文本换行不生效,显示br标签的问题
This commit is contained in:
parent
304e76e4af
commit
edddbbd1d6
@ -131,11 +131,11 @@ export default {
|
|||||||
let data = this.mindMap.getData()
|
let data = this.mindMap.getData()
|
||||||
data.root = true // 标记根节点
|
data.root = true // 标记根节点
|
||||||
let walk = root => {
|
let walk = root => {
|
||||||
let text = (root.data.richText
|
let text = root.data.richText
|
||||||
? nodeRichTextToTextWithWrap(root.data.text)
|
? nodeRichTextToTextWithWrap(root.data.text)
|
||||||
: root.data.text
|
: root.data.text
|
||||||
).replaceAll(/\n/g, '<br>')
|
|
||||||
text = htmlEscape(text)
|
text = htmlEscape(text)
|
||||||
|
text = text.replaceAll(/\n/g, '<br>')
|
||||||
root.textCache = text // 保存一份修改前的数据,用于对比是否修改了
|
root.textCache = text // 保存一份修改前的数据,用于对比是否修改了
|
||||||
root.label = text
|
root.label = text
|
||||||
root.uid = root.data.uid
|
root.uid = root.data.uid
|
||||||
|
|||||||
@ -103,11 +103,11 @@ export default {
|
|||||||
let data = this.mindMap.getData()
|
let data = this.mindMap.getData()
|
||||||
data.root = true // 标记根节点
|
data.root = true // 标记根节点
|
||||||
let walk = root => {
|
let walk = root => {
|
||||||
let text = (root.data.richText
|
let text = root.data.richText
|
||||||
? nodeRichTextToTextWithWrap(root.data.text)
|
? nodeRichTextToTextWithWrap(root.data.text)
|
||||||
: root.data.text
|
: root.data.text
|
||||||
).replaceAll(/\n/g, '<br>')
|
|
||||||
text = htmlEscape(text)
|
text = htmlEscape(text)
|
||||||
|
text = text.replaceAll(/\n/g, '<br>')
|
||||||
root.textCache = text // 保存一份修改前的数据,用于对比是否修改了
|
root.textCache = text // 保存一份修改前的数据,用于对比是否修改了
|
||||||
root.label = text
|
root.label = text
|
||||||
root.uid = root.data.uid
|
root.uid = root.data.uid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user