优化工作流操作对MacOS的删除键设置,提升跨平台用户体验

This commit is contained in:
jxxghp
2025-04-02 14:23:49 +08:00
parent 697fd57bc7
commit a98bf08b2d

View File

@@ -148,6 +148,11 @@ onMounted(() => {
edges.value = props.workflow.flows ?? []
}
})
// 判断是不是MACOS
const isMacOS = computed(() => {
return /Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.userAgent)
})
</script>
<template>
@@ -187,7 +192,7 @@ onMounted(() => {
:edge-updater-radius="10"
@dragover="onDragOver"
@dragleave="onDragLeave"
:delete-key-code="['Delete', 'Backspace']"
:delete-key-code="isMacOS ? 'Backspace' : 'Delete'"
auto-connect
>
<MiniMap />