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