mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-14 11:37:02 +08:00
commit
26291ede7e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"pluginName": "剪贴板",
|
"pluginName": "超级剪贴板",
|
||||||
"description": "强大的剪贴板管理工具",
|
"description": "强大的剪贴板管理工具",
|
||||||
"author": "ZiuChen",
|
"author": "ZiuChen",
|
||||||
"homepage": "https://github.com/ZiuChen",
|
"homepage": "https://github.com/ZiuChen",
|
||||||
|
@ -17,16 +17,16 @@
|
|||||||
<template v-if="item.type === 'text'">
|
<template v-if="item.type === 'text'">
|
||||||
<div
|
<div
|
||||||
class="clip-data-status"
|
class="clip-data-status"
|
||||||
v-if="item.data.length >= 500"
|
v-if="item.data.split(`\n`).length - 1 > 8"
|
||||||
@click.stop="handleDataClick(item)"
|
@click.stop="handleDataClick(item)"
|
||||||
>
|
>
|
||||||
查看全部
|
查看全部
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.data.slice(0, 500).trim() }}</div>
|
<div>{{ item.data.split(`\n`).slice(0, 8).join(`\n`).trim() }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.type === 'image'">
|
<template v-if="item.type === 'image'">
|
||||||
<img class="clip-data-image" :src="item.data" alt="Image" />
|
<img class="clip-data-image" :src="item.data" alt="Image" />
|
||||||
<div class="clip-data-status">{{ item.size }}</div>
|
<div class="clip-data-status image">{{ item.size }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.type === 'file'">
|
<template v-if="item.type === 'file'">
|
||||||
<div
|
<div
|
||||||
@ -53,6 +53,10 @@ const props = defineProps({
|
|||||||
showList: {
|
showList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
fullData: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['onDataChange'])
|
const emit = defineEmits(['onDataChange'])
|
||||||
@ -78,11 +82,11 @@ watch(
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 监听键盘事件
|
// 监听键盘事件
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
const { key, ctrlKey } = e
|
const { key, ctrlKey, metaKey } = e
|
||||||
const isArrowUp = key === 'ArrowUp'
|
const isArrowUp = key === 'ArrowUp'
|
||||||
const isArrowDown = key === 'ArrowDown'
|
const isArrowDown = key === 'ArrowDown'
|
||||||
const isEnter = key === 'Enter'
|
const isEnter = key === 'Enter'
|
||||||
const isCopy = ctrlKey && (key === 'C' || key === 'c')
|
const isCopy = (ctrlKey || metaKey) && (key === 'C' || key === 'c')
|
||||||
if (isArrowUp) {
|
if (isArrowUp) {
|
||||||
if (activeIndex.value > 0) {
|
if (activeIndex.value > 0) {
|
||||||
activeIndex.value--
|
activeIndex.value--
|
||||||
@ -104,7 +108,9 @@ onMounted(() => {
|
|||||||
?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
|
?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
|
||||||
}
|
}
|
||||||
} else if (isCopy) {
|
} else if (isCopy) {
|
||||||
window.copy(props.showList[activeIndex.value])
|
if (props.fullData.data === '') {
|
||||||
|
window.copy(props.showList[activeIndex.value])
|
||||||
|
}
|
||||||
} else if (isEnter) {
|
} else if (isEnter) {
|
||||||
window.copy(props.showList[activeIndex.value])
|
window.copy(props.showList[activeIndex.value])
|
||||||
window.paste()
|
window.paste()
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border: 0px solid @bg-color;
|
border: 0px solid @bg-color;
|
||||||
/* 有上边框占用px 但是不显示(与背景同色) */
|
margin: 0px 5px;
|
||||||
border-width: 1px 0px 1px 0px;
|
/* 占用px 但是不显示(与背景同色) */
|
||||||
border-color: @bg-color @bg-color #eee @bg-color;
|
border-width: 1px 1px 1px 1px;
|
||||||
|
border-color: @text-bg-color-lighter @bg-color @text-bg-color-lighter @bg-color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&.active {
|
&.active {
|
||||||
border: 0px solid @primary-color;
|
border: 0px solid @primary-color;
|
||||||
border-width: 1px 0px 1px 0px;
|
border-width: 1px 1px 1px 1px;
|
||||||
background-color: @text-bg-color-lighter;
|
background-color: @text-bg-color-lighter;
|
||||||
}
|
}
|
||||||
.clip-info {
|
.clip-info {
|
||||||
@ -46,19 +47,24 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
img.clip-data-image {
|
img.clip-data-image {
|
||||||
|
// 此 class用于区分 file的 image
|
||||||
max-height: 140px; // 比外框 max-height少一点 因为有 5px的边框
|
max-height: 140px; // 比外框 max-height少一点 因为有 5px的边框
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
background-color: @text-color-lighter;
|
background-color: @bg-color;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
.clip-data-status {
|
.clip-data-status {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
color: @bg-color;
|
color: @text-color;
|
||||||
background-color: @text-color-lighter;
|
background-color: @primary-color-lighter;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 3px;
|
padding: 2px;
|
||||||
|
font-size: 13px;
|
||||||
|
&.image {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
font-size: 13px;
|
||||||
&:hover {
|
&:hover {
|
||||||
font-weight: 600;
|
text-decoration: underline;
|
||||||
&::after {
|
&::after {
|
||||||
content: '📤';
|
content: '📤';
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<ClipFullData
|
<ClipFullData
|
||||||
:isShow="fullDataShow"
|
:isShow="fullDataShow"
|
||||||
:fullData="fullData"
|
:fullData="fullData"
|
||||||
@onOverlayClick="toggleFullData('')"
|
@onOverlayClick="toggleFullData({ type: 'text', data: '' })"
|
||||||
></ClipFullData>
|
></ClipFullData>
|
||||||
<ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick">
|
<ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick">
|
||||||
<template #SidePanel>
|
<template #SidePanel>
|
||||||
@ -13,7 +13,8 @@
|
|||||||
</ClipSwitch>
|
</ClipSwitch>
|
||||||
<div class="clip-break"></div>
|
<div class="clip-break"></div>
|
||||||
<div class="clip-empty-status" v-if="showList.length === 0">📪 无记录</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -139,6 +140,7 @@ onMounted(() => {
|
|||||||
window.focus()
|
window.focus()
|
||||||
} else if (isExit) {
|
} else if (isExit) {
|
||||||
filterText.value = ''
|
filterText.value = ''
|
||||||
|
} else if (ctrlKey) {
|
||||||
} else {
|
} else {
|
||||||
window.focus() // 其他键盘事件 直接聚焦搜索框
|
window.focus() // 其他键盘事件 直接聚焦搜索框
|
||||||
}
|
}
|
||||||
@ -168,7 +170,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.clip-break {
|
.clip-break {
|
||||||
height: 55px;
|
height: 60px;
|
||||||
}
|
}
|
||||||
.clip-empty-status {
|
.clip-empty-status {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user