提交 56eb414b 编写于 作者: X xjh22222228

feat(search): bind enter key

上级 eb807d20
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
import hotkeys from 'hotkeys-js'
import config from '../../../nav.config'
import { Component } from '@angular/core'
import { getDefaultSearchEngine, setDefaultSearchEngine, queryString } from '../../utils'
......@@ -31,6 +32,14 @@ export class SearchEngineComponent {
document.addEventListener('click', () => {
this.toggleEngine(null, false)
})
hotkeys('enter', () => {
this.inputFocus()
})
}
ngOnDestroy() {
hotkeys.unbind()
}
toggleEngine(e?: Event, isShow?: boolean) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册