Skip to content

Commit

Permalink
fix: the button for copying code is not initialized after switching p…
Browse files Browse the repository at this point in the history
…review status
  • Loading branch information
imzbf committed Mar 1, 2023
1 parent ee8fdd0 commit bfab8a1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MdEditor/layouts/Content/composition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ export const useAutoScroll = (
(previewRef.value as HTMLElement) || htmlRef.value
);
initScrollAuto();
initCopyEntry();
});
}
};
Expand Down Expand Up @@ -727,6 +728,12 @@ export const useAutoScroll = (
});
};

/**
* 处理输入框中的一些交互事件,例如:列表回车生成一个新的空行列表等
*
* @param props ContentProps
* @param textAreaRef 输入框
*/
export const useAutoGenrator = (props: ContentProps, textAreaRef: Ref) => {
const previewOnly = inject('previewOnly') as boolean;
const tabWidth = inject('tabWidth') as number;
Expand Down Expand Up @@ -833,6 +840,10 @@ export const useAutoGenrator = (props: ContentProps, textAreaRef: Ref) => {
);
};

/**
* 注册katex扩展到marked
*
*/
export const useMermaid = (props: ContentProps) => {
const theme = inject('theme') as ComputedRef<string>;
const { editorExtensions } = configOption;
Expand Down Expand Up @@ -893,6 +904,9 @@ export const useMermaid = (props: ContentProps) => {
return mermaidData;
};

/**
* 处理粘贴板
*/
export const usePasteUpload = (props: ContentProps, textAreaRef: Ref) => {
const editorId = inject('editorId') as string;
const previewOnly = inject('previewOnly') as boolean;
Expand Down

0 comments on commit bfab8a1

Please sign in to comment.