tinyMCE富文本编辑器如何设置默认的图片宽度

大佬们 我想在用户上传图片后给编辑器里的图片设置一个默认宽度 这该在哪里进行设置啊

以下是我现在的tinyMCE初始化设置

tinymce.init({
            selector: '#' + this.elementId,
            height: 400,
            plugins: ['link', 'table', 'image'],
            skin_url: 'assets/skins/lightgray',
            // image_dimensions: false,
            init_instance_callback : function(editor) {
              setTimeout(function(){
                console.log(self.model);
                if (self.model.content === undefined) {
                  editor.setContent("");
                } else {
                  editor.setContent(self.model.content);
                }
              },1000)
            },
            setup: editor => {
                editor.on('keyup change', () => {
                    const content = editor.getContent();
                    self.model.content = editor.getContent()
                });
            },
            // 图片上传功能
            images_upload_handler: function(blobInfo, success, failure) {
                var formData;
                formData = new FormData();
                formData.append("file", blobInfo.blob(), blobInfo.filename());
                self.uploadFile(`${environment.host}/admin.php/brand/common/upload`, formData).subscribe( response => {
                  var str = JSON.stringify(response);
                  var selfimgurl = JSON.parse(str)
                  console.log(selfimgurl)
                  success(selfimgurl.link);
                });
            }
        });

阅读 9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题