-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
图片上传建议 #913
Comments
同求 |
|
instance.toolbarHandlers.image = () => {
Modal.info({
width: 550,
title: '上传图片',
content: UploadForm,
getContainer:
(document.querySelector('.react-markdown-cmp') as HTMLDivElement) ||
document.body,
onOk: () => {
console.log('inpiu', instance.getCursor());
console.log('instance.insertValue', instance.insertValue);
if (inputRef.current?.input.value) {
// eslint-disable-next-line react/no-this-in-sfc
instance.insertValue(`![](${inputRef.current?.input.value})`);
}
},
});
return false;
}; instance是调用editormd后返回的实例 |
有点太复杂啦,可可看看我的方案,没多少行代码 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
建议图片上传功能修改成ajax方式进行上传,跨域上传使用jsonp方式,from表单中添加headers认证参数等信息post很不好处理
The text was updated successfully, but these errors were encountered: