使用富文本類型: vue-quill-editor
注意: 富文本導出 html 我們使用的時候, 樣式凸顯不出來
DOM 結構
<p><sub class="ql-size-large">測試內容</sub><sup class="ql-size-large">222222</sup></p>
一般編輯器導出內容:樣式會 以style 形式嵌入, 但是這個的話,確是樣式, 所以我們需要 下載對應的文件包
解決:
版本: "quill": "1.3.7",
npm install quill@1.3.7
import 'quill/dist/quill.core.css'
但是我發現一個問題,就是 每個樣式前面多多了一個 類名 .ql-editor
.ql-editor .ql-size-small {font-size: 0.75em;
}
.ql-editor .ql-size-large {font-size: 1.5em;
}
更dom 結構里的不一樣,其實還是不會生效的, 所以解決方案就是在 富文本 父級dom 加入 .ql-editor 類
<div class="ql-editor" v-html="mouldData"></div>
至此解決富文本導出,在其他頁面樣式不能展現的問題。
如果有其他無法顯示的問題,都是類似這種解決方案:
關于前端vue 使用富文本
推薦使用 :https://javaforall.cn/132756.html
文檔:https://www.wangeditor.com/v5/getting-started.html
文檔:https://www.wangeditor.com/demo/like-qq-doc.html
官網:http://tinymce.ax-z.cn/
官網:http://kindeditor.net/demo.php
參考使用:http://www.zzvips.com/article/212768.html
ps:其他 (與文本無關
element-ui table滾動到底部加載下一頁
let that = thisthis.$refs.screenTable.bodyWrapper.addEventListener('scroll', function () {let clientHeight = this.clientHeightlet scrollTop = this.scrollToplet scrollHeight = this.scrollHeightif (clientHeight + scrollTop === scrollHeight) {// 滾動到最底時,加載下一頁// if (that.total <= that.index && !this.popover) return// that.index += 1// 滾動條回滾至頂部// this.$refs.screenTable.bodyWrapper.scrollTop = 0}}, true)