Procházet zdrojové kódy

fix: 工具栏配置改为空对象,启用 wangEditor 全部已注册菜单默认集

之前错误使用了 strikeThrough(实际是 through)和 mergeCells(无此菜单)
等无效 key,导致部分按钮无法渲染。改用默认空配置让 wangEditor
渲染 basic-modules + list-module + table-module + upload-image-module
+ code-highlight 等所有内置模块的菜单。
Developer před 6 dny
rodič
revize
62c47b5179
2 změnil soubory, kde provedl 3 přidání a 37 odebrání
  1. binární
      dist.zip
  2. 3 37
      src/components/editor/index.vue

binární
dist.zip


+ 3 - 37
src/components/editor/index.vue

@@ -95,43 +95,9 @@ export default {
                 mode: 'default'
             })
 
-            // 工具栏:wangEditor 5 全部内置菜单(对齐老 Quill 的完整功能集)
-            const toolbarConfig = {
-                toolbarKeys: [
-                    'undo', 'redo',
-                    '|',
-                    'headerSelect',
-                    'bold', 'italic', 'underline', 'strikeThrough',
-                    'code', 'sub', 'sup',
-                    '|',
-                    'color', 'bgColor',
-                    '|',
-                    'fontSize', 'fontFamily',
-                    'lineHeight',
-                    '|',
-                    'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyJustify',
-                    '|',
-                    'bulletedList', 'numberedList',
-                    'indent', 'delIndent',
-                    '|',
-                    'insertImage', 'uploadImage', 'deleteImage', 'editImage',
-                    '|',
-                    'insertTable', 'tableFullWidth', 'deleteTable',
-                    'insertTableRow', 'deleteTableRow',
-                    'insertTableCol', 'deleteTableCol',
-                    'tableHeader', 'mergeCells',
-                    '|',
-                    'insertLink', 'editLink', 'unLink',
-                    '|',
-                    'blockquote', 'codeBlock', 'todo',
-                    '|',
-                    'divider', 'splitLine', 'clearStyle',
-                    '|',
-                    'emotion',
-                    '|',
-                    'fullScreen', 'preview'
-                ]
-            }
+            // 工具栏:不指定 toolbarKeys,使用 wangEditor 5 默认全部已注册菜单
+            // (basic-modules + list-module + table-module + upload-image-module + code-highlight 等)
+            const toolbarConfig = {}
 
             this.toolbar = createToolbar({
                 editor: this.editor,