鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ vue-froala-editor富文本的各種bug問題?

vue-froala-editor富文本的各種bug問題?

最近公司后臺需用到富文本編輯器:(出現(xiàn)幾下幾個問題沒找到解決辦法,求各路大神指點)?

正常顯示情況:
clipboard.png

出現(xiàn)的問題:
問題一:富文本編輯在輸入時會莫名其妙變成以下textarea樣式(下圖一)。
我想是綁定的tag的問題,結(jié)果去掉:tag就變成(下圖三)的顯示情況,只是一個普通的文本字體。
clipboard.png

clipboard.png

clipboard.png

問題二:vue-froala-editor的引入問題,不知道什么font文件沒引入還是引入錯誤了

clipboard.png

問題三:每個換行的br標(biāo)簽都會被一個p標(biāo)簽包裹,
由于前端需要后臺編輯時把p標(biāo)簽都替換成br標(biāo)簽,
所以,<p></p> 正常一個br標(biāo)簽替換后就成了兩個br標(biāo)簽多換行了。

clipboard.png

問題四:如何去掉工具欄多余的工具,只想顯示編輯文字的操作

clipboard.png

回答
編輯回答
大濕胸

問題四:
在編輯器初始化配置中添加:

toolbarButtons: ['fullscreen', 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|', 'fontFamily', 'fontSize', 'color', 'inlineStyle', 'paragraphStyle', '|', 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', '-', 'insertLink', 'insertImage', 'insertVideo', 'embedly', 'insertFile', 'insertTable', '|', 'emoticons', 'specialCharacters', 'insertHR', 'selectAll', 'clearFormatting', '|', 'print', 'spellChecker', 'help', 'html', '|', 'undo', 'redo']

根據(jù)你的需要刪除就行了

另外想問一下問題一是怎么解決的,我也遇到了,用的是Mac

2017年5月19日 00:02