mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-06 21:34:08 +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": "超级剪贴板",
|
||||
"description": "强大的剪贴板管理工具",
|
||||
"author": "ZiuChen",
|
||||
|
@ -197,6 +197,7 @@ utools.onPluginEnter(() => {
|
||||
utools.copyText('ImageOverSized')
|
||||
globalOverSize = false
|
||||
}
|
||||
document.querySelector('.clip-search input').select() // 进入插件将搜索框内容全选
|
||||
focus()
|
||||
toTop()
|
||||
resetNav()
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
<script setup>
|
||||
import FileList from './FileList.vue'
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
isShow: {
|
||||
@ -30,6 +31,17 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['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>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="clip-search">
|
||||
<input v-model="filterText" type="text" placeholder="🔍 检索剪贴板历史" />
|
||||
<span v-show="filterText" @click="clear" class="clip-search-suffix">✖</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -16,11 +17,14 @@ const filterText = ref('')
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
// filterText变了 通知父组件修改 modelValue的值
|
||||
watch(filterText, (val) => emit('update:modelValue', val))
|
||||
|
||||
// modelValue变了 更新 filterText的值
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => (filterText.value = val)
|
||||
)
|
||||
|
||||
const clear = () => emit('update:modelValue', '')
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -18,4 +18,20 @@
|
||||
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 (multiple) './cpns/clip-full-data.less';
|
||||
@import (multiple) './cpns/clip-item-list.less';
|
||||
@import (multiple) './cpns/clip-search.less';
|
||||
|
@ -123,7 +123,7 @@ onMounted(() => {
|
||||
|
||||
// 监听键盘事件
|
||||
document.addEventListener('keydown', (e) => {
|
||||
const { key, ctrlKey } = e
|
||||
const { key, ctrlKey, metaKey } = e
|
||||
const isTab = key === 'Tab'
|
||||
const isSearch =
|
||||
key === '/' ||
|
||||
@ -139,8 +139,13 @@ onMounted(() => {
|
||||
} else if (isSearch) {
|
||||
window.focus()
|
||||
} else if (isExit) {
|
||||
if (filterText.value) {
|
||||
filterText.value = ''
|
||||
} else if (ctrlKey) {
|
||||
e.stopPropagation()
|
||||
}
|
||||
} else if (ctrlKey || metaKey) {
|
||||
// 仅有 Ctrl时 什么也不执行
|
||||
// utools模拟执行粘贴时触发
|
||||
} else {
|
||||
window.focus() // 其他键盘事件 直接聚焦搜索框
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user