0
点赞
收藏
分享

微信扫一扫

wangeditor富文本图片上传

慕犹清 2022-01-26 阅读 47
p2plinqgnu

1、自定义上传方法

editor.config.customUploadImg = (files, insert) => { this.uploadFn(files, insert) }

2、调用接口上传

async uploadFn (files, insert) {

        const file = new FormData()

        file.append('file', files[0])

        await post(`路径地址`,file).then(res => {

                insert(res.data.result)

        })

}      

举报

相关推荐

0 条评论