fix: 区分Mac平台 采用旧的剪贴板监听方式

This commit is contained in:
ZiuChen
2022-09-21 16:33:02 +08:00
parent d5332e69af
commit b4dc9f803b
7 changed files with 75 additions and 27 deletions

View File

@@ -226,10 +226,25 @@ onMounted(() => {
updateShowList(activeTab.value)
// 定期检查更新
window.listener.on('change', () => {
list.value = window.db.dataBase.data
updateShowList(activeTab.value)
})
if (!utools.isMacOs) {
window.listener.on('change', () => {
list.value = window.db.dataBase.data
updateShowList(activeTab.value)
})
} else {
// macos
let prev = {}
setInterval(() => {
const now = window.db.dataBase.data[0]
if (prev?.id === now?.id) {
} else {
// 有更新
list.value = window.db.dataBase.data
updateShowList(activeTab.value)
prev = now
}
}, 800)
}
// 监听搜索框
watch(filterText, (val) => updateShowList(activeTab.value))