html5使用Drag事件编辑器拖拽上传图片的示例代码

2020-04-24 19:29:49易采站长站整理

//新一行的图片显示
editor.insertValue("n![" + ret.data.title + "](" + ret.data.path + ")");
}
});
});

//拖拽上传图片
Edtools.drag("#post_content", function (base64, image, event) {
$.post("{:url('api/uploader/upEditorImg')}",{base:base64}, function (ret) {
layer.msg(ret.msg);
if (ret.code === 1) {
//新一行的图片显示
editor.insertValue("n![" + ret.data.title + "](" + ret.data.path + ")");
}
});
});