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:
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Type check
|
- name: Type check
|
||||||
run: npx vue-tsc --noEmit
|
run: pnpm exec vue-tsc --noEmit
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
@@ -102,7 +102,7 @@ jobs:
|
|||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build Tauri app
|
- name: Build Tauri app
|
||||||
run: pnpm tauri build --target ${{ matrix.target }}
|
run: pnpm tauri build
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ const visible = ref(false)
|
|||||||
const x = ref(0)
|
const x = ref(0)
|
||||||
const y = ref(0)
|
const y = ref(0)
|
||||||
let targetEl: HTMLElement | null = null
|
let targetEl: HTMLElement | null = null
|
||||||
let cleanup: (() => void) | null = null
|
|
||||||
|
|
||||||
function show(ev: MouseEvent, el: HTMLElement) {
|
function show(ev: MouseEvent, el: HTMLElement) {
|
||||||
x.value = ev.clientX
|
x.value = ev.clientX
|
||||||
@@ -51,7 +50,6 @@ onMounted(() => {
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.removeEventListener('click', onClickOutside)
|
document.removeEventListener('click', onClickOutside)
|
||||||
if (cleanup) cleanup()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
defineExpose({ show, hide })
|
defineExpose({ show, hide })
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function refreshEntries() {
|
|||||||
:model-value="showPanel"
|
:model-value="showPanel"
|
||||||
title="全局变量管理"
|
title="全局变量管理"
|
||||||
width="500px"
|
width="500px"
|
||||||
@update:model-value="(val) => showPanel = val"
|
@update:model-value="(val: boolean) => showPanel = val"
|
||||||
@open="refreshEntries"
|
@open="refreshEntries"
|
||||||
@closed="newVarName = ''; newVarValue = ''"
|
@closed="newVarName = ''; newVarValue = ''"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ async function handleOpenLogDir() {
|
|||||||
logDirPath.value = await mqttGetLogDir()
|
logDirPath.value = await mqttGetLogDir()
|
||||||
}
|
}
|
||||||
// Try to open the directory using the opener plugin
|
// Try to open the directory using the opener plugin
|
||||||
const { open } = await import('@tauri-apps/plugin-opener')
|
const { openPath } = await import('@tauri-apps/plugin-opener')
|
||||||
await open(logDirPath.value)
|
await openPath(logDirPath.value)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
ElMessage.warning(`日志目录: ${logDirPath.value || '未知'}`)
|
ElMessage.warning(`日志目录: ${logDirPath.value || '未知'}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user