fix: 事件卸载错误

This commit is contained in:
wsgh0202 2025-06-25 23:49:11 +08:00
parent 7f199a7998
commit a3db419575
No known key found for this signature in database
GPG Key ID: F9658C3FEDCF6979

View File

@ -133,9 +133,9 @@ export default Vue.extend({
const eventTypes = ['mousedown', 'touchstart']
eventTypes.forEach(type => {
if (this.open) {
document.documentElement.addEventListener(type, e => this.openHandler(e))
document.documentElement.addEventListener(type, this.openHandler)
} else {
document.documentElement.removeEventListener(type, e => this.openHandler(e))
document.documentElement.removeEventListener(type, this.openHandler)
}
})
}