fix: 优化键盘监听事件的条件判断 #13 #15

This commit is contained in:
ZiuChen 2022-08-18 15:09:42 +08:00
parent 54a6c69a7a
commit b55b66271d
3 changed files with 13 additions and 4 deletions

View File

@ -53,6 +53,10 @@ const props = defineProps({
showList: {
type: Array,
required: true
},
fullData: {
type: Object,
required: true
}
})
const emit = defineEmits(['onDataChange'])
@ -104,7 +108,9 @@ onMounted(() => {
?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
}
} else if (isCopy) {
window.copy(props.showList[activeIndex.value])
if (props.fullData.data === '') {
window.copy(props.showList[activeIndex.value])
}
} else if (isEnter) {
window.copy(props.showList[activeIndex.value])
window.paste()

View File

@ -3,8 +3,9 @@
justify-content: flex-start;
align-items: center;
cursor: pointer;
font-size: 13px;
&:hover {
font-weight: 600;
text-decoration: underline;
&::after {
content: '📤';
}

View File

@ -4,7 +4,7 @@
<ClipFullData
:isShow="fullDataShow"
:fullData="fullData"
@onOverlayClick="toggleFullData('')"
@onOverlayClick="toggleFullData({ type: 'text', data: '' })"
></ClipFullData>
<ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick">
<template #SidePanel>
@ -13,7 +13,8 @@
</ClipSwitch>
<div class="clip-break"></div>
<div class="clip-empty-status" v-if="showList.length === 0">📪 无记录</div>
<ClipItemList :showList="showList" @onDataChange="toggleFullData"> </ClipItemList>
<ClipItemList :showList="showList" :fullData="fullData" @onDataChange="toggleFullData">
</ClipItemList>
</div>
</template>
@ -139,6 +140,7 @@ onMounted(() => {
window.focus()
} else if (isExit) {
filterText.value = ''
} else if (ctrlKey) {
} else {
window.focus() //
}