mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-10-24 05:21:20 +08:00
refactor: 调整悬浮按钮代码实现
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<ClipFloatBtn></ClipFloatBtn>
|
||||
<ClipFloatBtn :icon="'🧭'" @onBtnClick="restoreDataBase"></ClipFloatBtn>
|
||||
<ClipFullData
|
||||
:isShow="fullDataShow"
|
||||
:fullData="fullData"
|
||||
@@ -67,6 +67,15 @@ const updateShowList = (type) => {
|
||||
window.toTop()
|
||||
}
|
||||
|
||||
const restoreDataBase = () => {
|
||||
// 清空数据库
|
||||
const flag = window.confirm('确定要清空剪贴板记录吗?')
|
||||
if (flag) {
|
||||
window.db.emptyDataBase()
|
||||
updateShowList('all')
|
||||
}
|
||||
}
|
||||
|
||||
const handleNavClick = (type) => {
|
||||
updateShowList(type)
|
||||
offset.value = 0 // 重置懒加载偏移量
|
||||
@@ -160,6 +169,7 @@ onMounted(() => {
|
||||
}
|
||||
} else if (ctrlKey || metaKey || isArrow || isEnter) {
|
||||
// 仅有 Ctrl时 什么也不执行 (utools模拟执行粘贴时触发)
|
||||
e.preventDefault()
|
||||
} else {
|
||||
window.focus() // 其他键盘事件 直接聚焦搜索框
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user