diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx
index 065917e..0b1dff6 100755
--- a/apps/web/src/components/common/editor/MindEditor.tsx
+++ b/apps/web/src/components/common/editor/MindEditor.tsx
@@ -62,16 +62,16 @@ export default function MindEditor({ id }: { id?: string }) {
});
const { handleFileUpload } = useTusUpload();
const [form] = Form.useForm();
- const CustomLinkIconPlugin = (mind) => {
- mind.bus.addListener("operation", async () => {
- const hyperLinkElement =
- await document.querySelectorAll(".hyper-link");
- console.log("hyperLinkElement", hyperLinkElement);
- hyperLinkElement.forEach((item) => {
- const hyperLinkDom = createRoot(item);
- hyperLinkDom.render();
- });
+ const handleIcon = () => {
+ const hyperLinkElement =document.querySelectorAll(".hyper-link");
+ console.log("hyperLinkElement", hyperLinkElement);
+ hyperLinkElement.forEach((item) => {
+ const hyperLinkDom = createRoot(item);
+ hyperLinkDom.render();
});
+ }
+ const CustomLinkIconPlugin = (mind) => {
+ mind.bus.addListener("operation", handleIcon)
};
useEffect(() => {
if (post?.id && id) {
@@ -133,7 +133,11 @@ export default function MindEditor({ id }: { id?: string }) {
containerRef.current.hidden = true;
//挂载实例
setInstance(mind);
+
}, [canEdit]);
+ useEffect(() => {
+ handleIcon()
+ });
useEffect(() => {
if ((!id || post) && instance) {
containerRef.current.hidden = false;
@@ -204,7 +208,7 @@ export default function MindEditor({ id }: { id?: string }) {
}
console.log(result);
},
- (error) => {},
+ (error) => { },
`mind-thumb-${new Date().toString()}`
);
};