大佬们 我想在用户上传图片后给编辑器里的图片设置一个默认宽度 这该在哪里进行设置啊
以下是我现在的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);
});
}
});