Merge branch 'v1.1.4'

This commit is contained in:
ZiuChen 2022-08-20 11:51:43 +08:00
commit 1113a7717e
7 changed files with 43 additions and 4 deletions

View File

@ -1,5 +1,5 @@
{
"version": "1.1.3",
"version": "1.1.4",
"pluginName": "超级剪贴板",
"description": "强大的剪贴板管理工具",
"author": "ZiuChen",

View File

@ -197,6 +197,7 @@ utools.onPluginEnter(() => {
utools.copyText('ImageOverSized')
globalOverSize = false
}
document.querySelector('.clip-search input').select() // 进入插件将搜索框内容全选
focus()
toTop()
resetNav()

View File

@ -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>

View File

@ -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>

View File

@ -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;
}
}
}

View File

@ -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';

View File

@ -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() //
}