fix: TypeScript errors in CI

- ContextMenu: remove unused cleanup variable (never assigned, TS 6 infer as never)
- GlobalVariableManager: add explicit boolean type to event handler param
- LogPanel: use openPath instead of deprecated open from @tauri-apps/plugin-opener
This commit is contained in:
Joe Allen
2026-08-20 09:29:34 +08:00
parent 49f06f59fa
commit 25d9900880
4 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ jobs:
- run: pnpm install --frozen-lockfile
- name: Type check
run: npx vue-tsc --noEmit
run: pnpm exec vue-tsc --noEmit
- name: Build
run: pnpm build
@@ -102,7 +102,7 @@ jobs:
- run: pnpm install --frozen-lockfile
- name: Build Tauri app
run: pnpm tauri build --target ${{ matrix.target }}
run: pnpm tauri build
- name: Upload artifact
uses: actions/upload-artifact@v4
-2
View File
@@ -18,7 +18,6 @@ const visible = ref(false)
const x = ref(0)
const y = ref(0)
let targetEl: HTMLElement | null = null
let cleanup: (() => void) | null = null
function show(ev: MouseEvent, el: HTMLElement) {
x.value = ev.clientX
@@ -51,7 +50,6 @@ onMounted(() => {
onUnmounted(() => {
document.removeEventListener('click', onClickOutside)
if (cleanup) cleanup()
})
defineExpose({ show, hide })
@@ -50,7 +50,7 @@ function refreshEntries() {
:model-value="showPanel"
title="全局变量管理"
width="500px"
@update:model-value="(val) => showPanel = val"
@update:model-value="(val: boolean) => showPanel = val"
@open="refreshEntries"
@closed="newVarName = ''; newVarValue = ''"
>
+2 -2
View File
@@ -57,8 +57,8 @@ async function handleOpenLogDir() {
logDirPath.value = await mqttGetLogDir()
}
// Try to open the directory using the opener plugin
const { open } = await import('@tauri-apps/plugin-opener')
await open(logDirPath.value)
const { openPath } = await import('@tauri-apps/plugin-opener')
await openPath(logDirPath.value)
} catch (e: any) {
ElMessage.warning(`日志目录: ${logDirPath.value || '未知'}`)
}