forked from Gitlink/forgeplus-react
md@谁列表
This commit is contained in:
parent
5c2330512e
commit
999a15761d
|
@ -13,7 +13,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/edu-purge.css">
|
||||
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/editormd.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/merge.css">
|
||||
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/jquery.atwho.css">
|
||||
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/jquery.atwho.min.css">
|
||||
<%= htmlWebpackPlugin.tags.headTags %>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -27,8 +27,8 @@
|
|||
<script src="%PUBLIC_URL%js/editormd/editormd.min.js"></script>
|
||||
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
|
||||
<!--markdown编辑器中@谁-->
|
||||
<script src="%PUBLIC_URL%js/jquery.caret.js"></script>
|
||||
<script src="%PUBLIC_URL%js/jquery.atwho.js"></script>
|
||||
<script src="%PUBLIC_URL%js/jquery.caret.min.js"></script>
|
||||
<script src="%PUBLIC_URL%js/jquery.atwho.min.js"></script>
|
||||
<%= htmlWebpackPlugin.tags.bodyTags %>
|
||||
</body>
|
||||
</html>
|
|
@ -6,6 +6,7 @@ import ResizeObserver from 'resize-observer-polyfill';
|
|||
import '../../courses/css/Courses.css';
|
||||
import './css/TPMchallengesnew.css';
|
||||
import 'codemirror/lib/codemirror.css';
|
||||
import { AutoComplete } from 'antd';
|
||||
const $ = window.$
|
||||
|
||||
const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear"];
|
||||
|
@ -200,6 +201,10 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
}
|
||||
if (onChange) {
|
||||
editorInstance.cm.on('change', (cm) => {
|
||||
$(`#editorBodyId`).atwho({
|
||||
at: '@',
|
||||
data:['111','222']
|
||||
})
|
||||
// if(forMember){
|
||||
// document.onkeydown = (e) => {
|
||||
// if (e.key === "@") {
|
||||
|
@ -225,6 +230,11 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
|
||||
useEffect(() => {
|
||||
if (editorInstance && initValue !== undefined) {
|
||||
$(`#editorBodyId`).atwho({
|
||||
at: '@',
|
||||
data:['111','222']
|
||||
})
|
||||
const val = editorInstance.getValue();
|
||||
if (initValue !== null && initValue !== editorInstance.getValue()) {
|
||||
editorInstance.setValue(initValue.toString())
|
||||
}
|
||||
|
@ -273,7 +283,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
<Fragment>
|
||||
<div ref={editorEl} className={`df ${className} ${imageExpand && 'editormd-image-click-expand'} `} >
|
||||
<div className={`edu-back-greyf5 radius4 editormd ${error ? 'error' : ''}`} id={containerId} >
|
||||
<textarea style={{ display: 'none' }} id={editorBodyId} name="content"></textarea>
|
||||
<textarea style={{ display: 'none' }} id={editorBodyId} name="content"><AutoComplete></AutoComplete></textarea>
|
||||
<div className="CodeMirror cm-s-defualt"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue