|
@@ -13,17 +13,16 @@ import 'quill/dist/quill.core.css'
|
|
|
import 'quill/dist/quill.snow.css'
|
|
import 'quill/dist/quill.snow.css'
|
|
|
import 'quill/dist/quill.bubble.css'
|
|
import 'quill/dist/quill.bubble.css'
|
|
|
import {
|
|
import {
|
|
|
- quillEditor
|
|
|
|
|
|
|
+ quillEditor,
|
|
|
|
|
+ Quill
|
|
|
} from 'vue-quill-editor'
|
|
} from 'vue-quill-editor'
|
|
|
-// Quill 1.3.6 的 ui/icons.js 不含 undo/redo,需手动注入 SVG
|
|
|
|
|
-const undoIcon = '<svg viewBox="0 0 18 18"><polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 2 14 6 14 4 12 6 10 8 7 14 7 14 11 16 11 16 4 8 4 6 7"></polygon></svg>'
|
|
|
|
|
-const redoIcon = '<svg viewBox="0 0 18 18"><polygon class="ql-fill ql-stroke" points="12 10 14 12 16 10 16 14 12 14 14 12 12 10 10 7 4 7 4 11 2 11 2 4 10 4 12 7"></polygon></svg>'
|
|
|
|
|
|
|
+// Quill 1.3.6 的 ui/icons.js 不含 undo/redo,需手动注入到全局 icons 映射,
|
|
|
|
|
+// 否则 snow 主题的 buildButtons 会因 icons[name] 为 null 跳过按钮 innerHTML 的渲染。
|
|
|
|
|
+const icons = Quill.import('ui/icons')
|
|
|
|
|
+icons['undo'] = '<svg viewbox="0 0 18 18"><polygon class="ql-fill ql-stroke" points="6 10 4 12 2 10 2 14 6 14 4 12 6 10 8 7 14 7 14 11 16 11 16 4 8 4 6 7"></polygon></svg>'
|
|
|
|
|
+icons['redo'] = '<svg viewbox="0 0 18 18"><polygon class="ql-fill ql-stroke" points="12 10 14 12 16 10 16 14 12 14 14 12 12 10 10 7 4 7 4 11 2 11 2 4 10 4 12 7"></polygon></svg>'
|
|
|
const toolbarOptions = [
|
|
const toolbarOptions = [
|
|
|
- [{
|
|
|
|
|
- 'undo': undoIcon
|
|
|
|
|
- }, {
|
|
|
|
|
- 'redo': redoIcon
|
|
|
|
|
- }], // 撤销,重做
|
|
|
|
|
|
|
+ ['undo', 'redo'], // 撤销,重做
|
|
|
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
|
|
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
|
|
|
['blockquote', 'code-block'], //引用,代码块
|
|
['blockquote', 'code-block'], //引用,代码块
|
|
|
[{
|
|
[{
|