mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-07 13:54:05 +08:00
fix: 清空剪贴板数据时视图未更新
This commit is contained in:
parent
afe74350e5
commit
dcdeb734d2
@ -101,8 +101,10 @@ export default function initPlugin() {
|
|||||||
this.updateDataBaseLocal()
|
this.updateDataBaseLocal()
|
||||||
}
|
}
|
||||||
emptyDataBase() {
|
emptyDataBase() {
|
||||||
|
this.dataBase.data = []
|
||||||
window.db.dataBase.data = []
|
window.db.dataBase.data = []
|
||||||
this.updateDataBaseLocal(this.defaultDB)
|
this.updateDataBaseLocal(this.defaultDB)
|
||||||
|
listener.emit('change')
|
||||||
}
|
}
|
||||||
filterDataBaseViaId(id) {
|
filterDataBaseViaId(id) {
|
||||||
return this.dataBase.data.filter((item) => item.id === id)
|
return this.dataBase.data.filter((item) => item.id === id)
|
||||||
|
@ -230,7 +230,14 @@ onMounted(() => {
|
|||||||
updateShowList(activeTab.value)
|
updateShowList(activeTab.value)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// macOS且监听器启动失败时
|
// macOS或监听器启动失败时
|
||||||
|
// 进程虽然没有启动 但是可以接收emit
|
||||||
|
window.listener.on('change', () => {
|
||||||
|
// 检查到change事件 更新展示数据
|
||||||
|
list.value = window.db.dataBase.data
|
||||||
|
updateShowList(activeTab.value)
|
||||||
|
})
|
||||||
|
|
||||||
let prev = {}
|
let prev = {}
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const now = window.db.dataBase.data[0]
|
const now = window.db.dataBase.data[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user