Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:Optimize JS page style #1081

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions packages/common/component/SvgButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span class="svg-button" :class="{ 'svg-button-hover': hoverBgColor }" @click="$emit('click', $event)">
<span class="svg-button" :class="{ 'svg-button-hover': hoverBgColor }" @click="handleClick($event)">
<tiny-tooltip effect="dark" :content="tips" :placement="placement">
<component :is="name" v-if="isTinyIcon" />
<svg-icon v-else :name="name"></svg-icon>
Expand Down Expand Up @@ -34,11 +34,17 @@ export default {
}
},
emits: ['click'],
setup(props) {
setup(props, { emit }) {
const isTinyIcon = computed(() => props.name.toLowerCase().indexOf('icon') === 0)

const handleClick = (event) => {
event.target.blur()
emit('click', event)
}

return {
isTinyIcon
isTinyIcon,
handleClick
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions packages/plugins/script/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ export default {
enabled: false
},
placeholder: `// ✅ 函数声明可以保存
\n function topLevelFunction(){ \n
\u200B \u200B const message = 'hello tiny-engine.' \n
function topLevelFunction(){
\u200B \u200B const message = 'hello tiny-engine.'
\u200B \u200B console.log(message)
\n }
\n
// ❌ 顶层/常规 变量声明 \n const someVariable = 42 \n
} \n
// ❌ 顶层/常规 变量声明 \n const someVariable = 42
// ❌ 表达式 \n const result = someVariable + 10`,

// 禁用滚动条边边一直显示的边框
Expand Down Expand Up @@ -185,4 +184,8 @@ export default {
margin-left: 5px;
}
}

:deep(.monaco-editor .editorPlaceholder) {
font-size: 12px !important;
}
</style>
Loading