Skip to content

Commit 45e023d

Browse files
author
winjo
committed
fix: 更改 monaco cdn及修复折叠样式
1 parent 2cdb627 commit 45e023d

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

packages/alex/src/api/createApp.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ const getDefaultAppConfig = (): IAppOpts => ({
7070
export const DEFAULT_APP_CONFIG = getDefaultAppConfig();
7171

7272
// 提前加载 monaco 并提前缓存 codeEditorService
73-
loadMonaco();
73+
loadMonaco({
74+
monacoCDNBase:
75+
'https://gw.alipayobjects.com/os/lib/alipay/ame/0.17.0-patch.4/out-monaco-editor-core/min/',
76+
});
7477
let codeEditorService: any = null;
7578
isMonacoLoaded()?.then(() => {
7679
codeEditorService = (monaco as any).services.StaticServices.codeEditorService;

packages/alex/src/api/createEditor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ const getDefaultAppConfig = (): IAppOpts => ({
5757
});
5858

5959
// 提前加载 monaco 并提前缓存 codeEditorService
60-
loadMonaco();
60+
loadMonaco({
61+
monacoCDNBase:
62+
'https://gw.alipayobjects.com/os/lib/alipay/ame/0.17.0-patch.4/out-monaco-editor-core/min/',
63+
});
6164
let codeEditorService: any = null;
6265
isMonacoLoaded()?.then(() => {
6366
codeEditorService = (monaco as any).services.StaticServices.codeEditorService;

packages/alex/src/core/style.module.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ alex-root {
8484
object-fit: contain;
8585
width: auto !important;
8686
}
87+
// acr 中把折叠 icon 给 display:none 了,这里再覆盖下
88+
.alex-root {
89+
.monaco-editor .margin-view-overlays .folding.collapsed,
90+
.monaco-editor .margin-view-overlays .folding.alwaysShowFoldIcons,
91+
.monaco-editor .margin-view-overlays:hover .folding {
92+
display: initial;
93+
}
94+
}
8795
}
8896

8997
:global(.alex-editor) .landing {

0 commit comments

Comments
 (0)