fix: 清空剪贴板数据时视图未更新

This commit is contained in:
ZiuChen 2022-10-10 20:19:45 +08:00
parent afe74350e5
commit dcdeb734d2
2 changed files with 10 additions and 1 deletions

View File

@ -101,8 +101,10 @@ export default function initPlugin() {
this.updateDataBaseLocal()
}
emptyDataBase() {
this.dataBase.data = []
window.db.dataBase.data = []
this.updateDataBaseLocal(this.defaultDB)
listener.emit('change')
}
filterDataBaseViaId(id) {
return this.dataBase.data.filter((item) => item.id === id)

View File

@ -230,7 +230,14 @@ onMounted(() => {
updateShowList(activeTab.value)
})
} else {
// macOS
// macOS
// emit
window.listener.on('change', () => {
// change
list.value = window.db.dataBase.data
updateShowList(activeTab.value)
})
let prev = {}
setInterval(() => {
const now = window.db.dataBase.data[0]