mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-10-26 07:21:22 +08:00
feat: fullData页内添加复制与分词功能 调整prop内容
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
<template>
|
||||
<div class="clip-full-data">
|
||||
<Transition name="fade">
|
||||
<div class="clip-full" v-show="isShow">
|
||||
<div v-if="fullData.type === 'text'">
|
||||
<div v-text="fullData.data"></div>
|
||||
<div class="clip-full-wrapper" v-show="isShow">
|
||||
<div class="clip-full-operate-list">
|
||||
<template v-for="{ id, name } of btns">
|
||||
<div
|
||||
class="clip-full-operate-list-item"
|
||||
v-if="id !== 'word-split' || (id === 'word-split' && fullData.type !== 'file')"
|
||||
@click="handleBtnClick(id)"
|
||||
>
|
||||
{{ name }}
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<FileList :data="fullData.data"></FileList>
|
||||
<template v-if="fullData.type === 'text'">
|
||||
<div class="clip-full-content" v-text="fullData.data"></div>
|
||||
</template>
|
||||
<div v-else class="clip-full-content">
|
||||
<FileList :data="JSON.parse(fullData.data)"></FileList>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
@@ -32,6 +43,28 @@ const props = defineProps({
|
||||
const emit = defineEmits(['onOverlayClick'])
|
||||
const onOverlayClick = () => emit('onOverlayClick')
|
||||
|
||||
const btns = [
|
||||
{
|
||||
id: 'copy-all',
|
||||
name: '📄 复制全部'
|
||||
},
|
||||
{
|
||||
id: 'word-split',
|
||||
name: '🎁 智慧分词'
|
||||
}
|
||||
]
|
||||
const handleBtnClick = (id) => {
|
||||
switch (id) {
|
||||
case 'copy-all':
|
||||
window.copy(props.fullData)
|
||||
emit('onOverlayClick') // 退出侧栏
|
||||
break
|
||||
case 'word-split':
|
||||
window.alert('增值服务 Comming Soon...')
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('keydown', (e) => {
|
||||
const { key } = e
|
||||
|
||||
Reference in New Issue
Block a user