forked from Gitlink/forgeplus-react
markdown
This commit is contained in:
parent
7795fe1d04
commit
e3c1e7b82f
|
@ -75,7 +75,7 @@ function md_elocalStorage(editor, mdu, id) {
|
|||
}
|
||||
|
||||
|
||||
export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, className = '', noStorage = false, imageExpand = true, placeholder = '', width = '100%', height = 400, initValue = '', emoji, watch, showNullButton = false, showResizeBar = false, startInit = true , forMember}) => {
|
||||
export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, className = '', noStorage = false, imageExpand = true, placeholder = '', width = '100%', height = 400, initValue = '', emoji, watch, showNullButton = false, showResizeBar = false, startInit = true , forMember = true }) => {
|
||||
|
||||
const editorEl = useRef();
|
||||
const resizeBarEl = useRef();
|
||||
|
@ -194,15 +194,14 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
}
|
||||
if (onChange) {
|
||||
editorInstance.cm.on('change', (cm) => {
|
||||
if(forMember){
|
||||
document.onkeydown = (e) => {
|
||||
if (e.key === "@") {
|
||||
// 输入@键后在对应的位置显示可选的项目成员
|
||||
console.log("e",document.selectionStart);
|
||||
console.log("e",document.getSelection());
|
||||
}
|
||||
};
|
||||
}
|
||||
// if(forMember){
|
||||
// document.onkeydown = (e) => {
|
||||
// if (e.key === "@") {
|
||||
// // 输入@键后在对应的位置显示可选的项目成员
|
||||
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
onChange(cm.getValue())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue