vue wangEditor上传图片到服务器
npm install wangeditor -Dimport E from 'wangeditor';const editor = new E('#editor');editor.customConfig.customUploadImg = (files, insert) => {const formData = new FormData();formData.appe...
·
npm install wangeditor -D
import E from 'wangeditor';
const editor = new E('#editor');
editor.customConfig.customUploadImg = (files, insert) => {
const formData = new FormData();
formData.append('file', files[0]);
formData.append('path', 'files/ne-icev3-dashboard/content/content/');
this.$axios._api_gateway.post('/file-service/upload/ali', formData).then(res => {
const result = res.data;
if (result.code === '000000') {
const data = result.data;
insert(data);
}
});
};
editor.create();
更多推荐
已为社区贡献6条内容
所有评论(0)