perf(@vant/use): reduce usePageVisibility event binding (#9835)

* perf(@vant/use): reduce usePageVisibility event binding

* chore: update
This commit is contained in:
neverland
2021-11-11 17:25:48 +08:00
committed by GitHub
parent a9ce9096e4
commit a0b368f1b4
4 changed files with 21 additions and 23 deletions
@@ -1,5 +1,4 @@
import { Ref, unref } from 'vue';
import { inBrowser } from '../utils';
import { useEventListener } from '../useEventListener';
export type UseClickAwayOptions = {
@@ -11,10 +10,6 @@ export function useClickAway(
listener: EventListener,
options: UseClickAwayOptions = {}
) {
if (!inBrowser) {
return;
}
const { eventName = 'click' } = options;
const onClick = (event: Event) => {