1. 程式人生 > javascript > TinyMCE編輯器沒有所有功能

【javascript】TinyMCE編輯器沒有所有功能

我在網站上的文字框中使用了TinyMCE編輯器,我遵循了這個https://www.tinymce.com/docs/get-started/first-steps/,它工作正常,但問題是我沒有所有功能。我的像下面的圖片
enter image description here

但是這是我期望的

enter image description here

解決辦法

這裡是您可以使用的全部功能(高階外掛除外):https://www.tinymce.com/docs/demo/full-featured/。您可能需要修改menubarpluginstoolbar

tinymce.init({
  selector: 'textarea',
  height: 500,
  theme: 'modern',
  plugins: [
    'advlist autolink lists link image charmap print preview hr anchor pagebreak',
    'searchreplace wordcount visualblocks visualchars code fullscreen',
    'insertdatetime media nonbreaking save table contextmenu directionality',
    'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc'
  ],
  toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
  toolbar2: 'print preview media | forecolor backcolor emoticons | codesample',
  image_advtab: true,
  templates: [
    { title: 'Test template 1', content: 'Test 1' },
    { title: 'Test template 2', content: 'Test 2' }
  ],
  content_css: [
    '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
    '//www.tinymce.com/css/codepen.min.css'
  ]
 });