fix: 修复listener挂载在window上的问题

This commit is contained in:
ZiuChen 2022-10-10 19:15:00 +08:00
parent 1e408a5770
commit 7418788f67
3 changed files with 3 additions and 2 deletions

View File

@ -293,4 +293,5 @@ export default function initPlugin() {
window.createFile = createFile window.createFile = createFile
window.focus = focus window.focus = focus
window.toTop = toTop window.toTop = toTop
window.listener = listener
} }

View File

@ -223,7 +223,7 @@ onMounted(() => {
updateShowList(activeTab.value) updateShowList(activeTab.value)
// //
if (!utools.isMacOs() && window.listener?.listening) { if (!utools.isMacOs() && window.listener.listening) {
// macOS // macOS
window.listener.on('change', () => { window.listener.on('change', () => {
list.value = window.db.dataBase.data list.value = window.db.dataBase.data

View File

@ -183,7 +183,7 @@ const handleRestoreBtnClick = () => {
} }
onMounted(() => { onMounted(() => {
listenStatus.value = window.listener?.listening listenStatus.value = window.listener.listening
}) })
</script> </script>