[release-2.0] fix: the global search keyboard event is not removed when the component is unmounted (#772)

This is an automated cherry-pick of #767

/assign JohnNiang

```release-note
None
```
pull/776/head
Halo Dev Bot 2022-12-14 15:14:55 +08:00 committed by GitHub
parent a3caa29efa
commit ec6f39ddd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ onMounted(() => {
}); });
onUnmounted(() => { onUnmounted(() => {
document.addEventListener("keydown", handleGlobalSearchKeybinding); document.removeEventListener("keydown", handleGlobalSearchKeybinding);
}); });
// Generate menus by routes // Generate menus by routes