mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-07 22:04:06 +08:00
Merge branch 'v1.1.4'
This commit is contained in:
commit
1113a7717e
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"pluginName": "超级剪贴板",
|
"pluginName": "超级剪贴板",
|
||||||
"description": "强大的剪贴板管理工具",
|
"description": "强大的剪贴板管理工具",
|
||||||
"author": "ZiuChen",
|
"author": "ZiuChen",
|
||||||
|
@ -197,6 +197,7 @@ utools.onPluginEnter(() => {
|
|||||||
utools.copyText('ImageOverSized')
|
utools.copyText('ImageOverSized')
|
||||||
globalOverSize = false
|
globalOverSize = false
|
||||||
}
|
}
|
||||||
|
document.querySelector('.clip-search input').select() // 进入插件将搜索框内容全选
|
||||||
focus()
|
focus()
|
||||||
toTop()
|
toTop()
|
||||||
resetNav()
|
resetNav()
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import FileList from './FileList.vue'
|
import FileList from './FileList.vue'
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isShow: {
|
isShow: {
|
||||||
@ -30,6 +31,17 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits(['onOverlayClick'])
|
const emit = defineEmits(['onOverlayClick'])
|
||||||
const onOverlayClick = () => emit('onOverlayClick')
|
const onOverlayClick = () => emit('onOverlayClick')
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
document.addEventListener('keydown', (e) => {
|
||||||
|
const { key } = e
|
||||||
|
if (key === 'Escape' && props.fullData.data) {
|
||||||
|
// 有值时执行退出 Overlay
|
||||||
|
emit('onOverlayClick')
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="clip-search">
|
<div class="clip-search">
|
||||||
<input v-model="filterText" type="text" placeholder="🔍 检索剪贴板历史" />
|
<input v-model="filterText" type="text" placeholder="🔍 检索剪贴板历史" />
|
||||||
|
<span v-show="filterText" @click="clear" class="clip-search-suffix">✖</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -16,11 +17,14 @@ const filterText = ref('')
|
|||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
// filterText变了 通知父组件修改 modelValue的值
|
// filterText变了 通知父组件修改 modelValue的值
|
||||||
watch(filterText, (val) => emit('update:modelValue', val))
|
watch(filterText, (val) => emit('update:modelValue', val))
|
||||||
|
|
||||||
// modelValue变了 更新 filterText的值
|
// modelValue变了 更新 filterText的值
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(val) => (filterText.value = val)
|
(val) => (filterText.value = val)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const clear = () => emit('update:modelValue', '')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -18,4 +18,20 @@
|
|||||||
color: @text-color-lighter;
|
color: @text-color-lighter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.clip-search-suffix {
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
top: 18px;
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 2px;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
background-color: @nav-bg-color;
|
||||||
|
border-radius: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
background-color: @nav-hover-bg-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
.import() {
|
.import() {
|
||||||
|
/* 导入全部涉及到变量的样式文件 */
|
||||||
@import (multiple) './cpns/clip-full-data.less';
|
@import (multiple) './cpns/clip-full-data.less';
|
||||||
@import (multiple) './cpns/clip-item-list.less';
|
@import (multiple) './cpns/clip-item-list.less';
|
||||||
@import (multiple) './cpns/clip-search.less';
|
@import (multiple) './cpns/clip-search.less';
|
||||||
|
@ -123,7 +123,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
// 监听键盘事件
|
// 监听键盘事件
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
const { key, ctrlKey } = e
|
const { key, ctrlKey, metaKey } = e
|
||||||
const isTab = key === 'Tab'
|
const isTab = key === 'Tab'
|
||||||
const isSearch =
|
const isSearch =
|
||||||
key === '/' ||
|
key === '/' ||
|
||||||
@ -139,8 +139,13 @@ onMounted(() => {
|
|||||||
} else if (isSearch) {
|
} else if (isSearch) {
|
||||||
window.focus()
|
window.focus()
|
||||||
} else if (isExit) {
|
} else if (isExit) {
|
||||||
filterText.value = ''
|
if (filterText.value) {
|
||||||
} else if (ctrlKey) {
|
filterText.value = ''
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
} else if (ctrlKey || metaKey) {
|
||||||
|
// 仅有 Ctrl时 什么也不执行
|
||||||
|
// utools模拟执行粘贴时触发
|
||||||
} else {
|
} else {
|
||||||
window.focus() // 其他键盘事件 直接聚焦搜索框
|
window.focus() // 其他键盘事件 直接聚焦搜索框
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user