mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-07 05:47:13 +08:00
feat: 添加多选状态下的快捷键支持
This commit is contained in:
parent
ec1c72447e
commit
290464d55e
@ -80,7 +80,7 @@ const props = defineProps({
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['onDataChange', 'onDataRemove', 'onSelectItemAdd'])
|
||||
const emit = defineEmits(['onDataChange', 'onDataRemove', 'onSelectItemAdd', 'onMultiCopyExecute'])
|
||||
const isOverSizedContent = (item) => {
|
||||
const { type, data } = item
|
||||
if (type === 'text') {
|
||||
@ -242,14 +242,23 @@ onMounted(() => {
|
||||
} else if (isCopy) {
|
||||
if (props.fullData.data === '') {
|
||||
// 如果侧栏中有数据 证明侧栏是打开的 不执行复制
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
if (!props.isMultiple) {
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
} else {
|
||||
emit('onMultiCopyExecute', false)
|
||||
}
|
||||
}
|
||||
} else if (isEnter) {
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
window.paste()
|
||||
if (!props.isMultiple) {
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
window.paste()
|
||||
} else {
|
||||
emit('onMultiCopyExecute', true)
|
||||
}
|
||||
} else if ((ctrlKey || metaKey || altKey) && isNumber) {
|
||||
window.copy(props.showList[parseInt(key) - 1])
|
||||
window.paste()
|
||||
selectItemList.value = []
|
||||
} else if (isShift) {
|
||||
if (props.isMultiple) {
|
||||
isShiftDown.value = true
|
||||
|
@ -45,6 +45,7 @@
|
||||
:fullData="fullData"
|
||||
:isMultiple="isMultiple"
|
||||
:currentActiveTab="outSideActiveTab"
|
||||
@onMultiCopyExecute="handleMultiCopyBtnClick"
|
||||
@onDataChange="toggleFullData"
|
||||
@onDataRemove="handleDataRemove"
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user