Quellcode durchsuchen

feat: Tinymce插件-增加字体大小功能

peter vor 5 Monaten
Ursprung
Commit
df721d8d12
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 2 0
      src/components/Tinymce/index.vue
  2. 1 1
      src/components/Tinymce/toolbar.js

+ 2 - 0
src/components/Tinymce/index.vue

@@ -158,6 +158,8 @@ export default {
         default_link_target: '_blank',
         link_title: false,
         nonbreaking_force_tab: true, // inserting nonbreaking space   need Nonbreaking Space Plugin
+        fontsize_formats: '10pt 12pt 14pt 16pt 18pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt 38pt 40pt 50pt 60pt',
+        content_style: 'body { font-size: 14pt; }', // 默认字体大小
         init_instance_callback: (editor) => {
           if (_this.value) {
             editor.setContent(_this.value)

+ 1 - 1
src/components/Tinymce/toolbar.js

@@ -1,6 +1,6 @@
 // Here is a list of the toolbar
 // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
 
-const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent  blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
+const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent  blockquote undo redo removeformat subscript superscript code codesample fontsizeselect', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
 
 export default toolbar