Skip to content

Commit

Permalink
feat: add hideConsole
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-lx committed Sep 19, 2023
1 parent 07f2f33 commit db2acc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export type CodeOptions = {
* @en Whether show the switch button of this function on the page
*/
showSwitch?: boolean;
/**
* @cn 是否隐藏在控制台的按键提示
* @en Whether hide the tips of combination keys on console.
*/
hideConsole?: boolean;
/**
* @cn 打开功能开关的情况下,点击触发跳转编辑器时是否自动关闭开关
* @en When opening the function switch, whether automatically close the switch when triggering the jump editor function.
Expand All @@ -52,6 +57,7 @@ export function getInjectCode(port: number, options?: CodeOptions) {
const {
hotKeys = ['shiftKey', 'altKey'],
showSwitch = false,
hideConsole = false,
autoToggle = true,
} = options || ({} as CodeOptions);
return `<code-inspector-component port=${port} hotKeys="${(hotKeys
Expand All @@ -60,7 +66,7 @@ export function getInjectCode(port: number, options?: CodeOptions) {
)?.join(',')}"
${showSwitch ? 'showSwitch=true' : ''} ${
autoToggle ? 'autoToggle=true' : ''
}></code-inspector-component>
} ${hideConsole ? 'hideConsole=true' : ''}></code-inspector-component>
<script type="text/javascript">
${jsCode}
</script>`;
Expand Down

0 comments on commit db2acc4

Please sign in to comment.