wangEditor富文本编辑器上传图片效果代码
代码语言:html
所属分类:上传
代码描述:wangEditor富文本编辑器上传图片效果代码
代码标签: wangEditor 富文本 编辑器 上传 图片
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> </head> <body> <p> wangEditor 上传图片 </p> <div id="div1"></div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/wangEditor.min.js"></script> <script > const E = window.wangEditor; const editor = new E("#div1"); editor.config.uploadImgServer = "/api/upload-img"; // editor.config.showLinkImg = false // editor.config.uploadImgShowBase64 = true // editor.config.linkImgCallback = function (url) { // console.log('linkImgCallback', url) // } // editor.config.uploadImgMaxSize = 10 * 1024 // 10kb // editor.config.customAlert = function (s) { // console.log('customAlert: ' + s) // } // editor.config.uploadImgMaxLength = 2 // editor.config.uploadFileName = 'my-file-name' // editor.config.uploadImgParams = { // x: 100, // y: 'abc' // } // editor.config.uploadImgParamsWithUrl = true // editor.config.uploadImgHeaders = { // .........完整代码请登录后点击上方下载按钮下载查看
网友评论0