mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-10-26 07:21:22 +08:00
refactor: 调整悬浮按钮代码实现
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
<template>
|
||||
<div class="clip-float-btn">
|
||||
<div @click="restoreDataBase">🧭</div>
|
||||
<div class="clip-float-btn" @click="handleBtnClick">
|
||||
<div>{{ props.icon }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// const emit = defineEmits(['onBtnClick'])
|
||||
// const handleBtnClick = () => emit('onBtnClick')
|
||||
const restoreDataBase = () => {
|
||||
// 清空数据库
|
||||
const flag = window.confirm('确定要清空剪贴板记录吗?')
|
||||
if (flag) {
|
||||
window.db.emptyDataBase()
|
||||
updateShowList('all')
|
||||
const emit = defineEmits(['onBtnClick'])
|
||||
const handleBtnClick = () => emit('onBtnClick')
|
||||
const props = defineProps({
|
||||
icon: {
|
||||
type: String,
|
||||
default: '🌎'
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user