-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
56 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { prefix } from '../config'; | ||
|
||
export const CDN_IDS = { | ||
hljs: `${prefix}-hljs`, | ||
hlcss: `${prefix}-hlCss`, | ||
prettier: `${prefix}-prettier`, | ||
prettierMD: `${prefix}-prettierMD`, | ||
cropperjs: `${prefix}-cropper`, | ||
croppercss: `${prefix}-cropperCss`, | ||
screenfull: `${prefix}-screenfull`, | ||
mermaidM: `${prefix}-mermaid-m`, | ||
mermaid: `${prefix}-mermaid`, | ||
katexjs: `${prefix}-katex`, | ||
katexcss: `${prefix}-katexCss` | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { CDN_IDS } from './MdEditor/static'; | ||
|
||
/** | ||
* 清空组件带来的副作用,例如 | ||
* 1. 使用CDN嵌入的链接,为了保证多个组件能够正常使用,组件在卸载时不会主动移除 | ||
*/ | ||
export const clearSideEffects = () => { | ||
(Object.keys(CDN_IDS) as Array<keyof typeof CDN_IDS>).forEach((key) => { | ||
const ele = document.getElementById(CDN_IDS[key]); | ||
|
||
if (ele) { | ||
ele.remove(); | ||
} | ||
}); | ||
}; |