Skip to content

Commit

Permalink
fix(core): 优化OCS环境加载问题
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Jun 12, 2022
1 parent 76335d9 commit 2742ed4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class="ocs-panel-header draggable"
>
<template
v-for="(item, index) in currentPanels.filter(p=>p.hide !== true)"
v-for="(item, index) in currentPanels.filter(p=>p.hide?.() !== true)"
:key="index"
>
<div
Expand All @@ -59,7 +59,7 @@
class="ocs-panel-container"
>
<template
v-for="(item, index) in currentPanels.filter(p=>p.hide !== true)"
v-for="(item, index) in currentPanels.filter(p=>p.hide?.() !== true)"
:key="index"
>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/core/define.script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ScriptPanel {
/** 当页面没有任何面板时,显示的默认面板 */
default?: boolean
/** 是否隐藏 */
hide?: boolean
hide?: () => boolean
}

export type ScriptPanelChild = Omit<ScriptPanel, 'url' | 'children'>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/script/icve/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const ICVEScript = defineScript({
},
{
name: '任务列表',
hide: useSettings().icve.common.type === 'MOOC',
hide: () => useSettings().icve.common.type === 'MOOC',
el: () => <TaskList selectable={false} />
},
createTerminalPanel()
Expand Down

0 comments on commit 2742ed4

Please sign in to comment.