chore(utils): isHidden support ref element

This commit is contained in:
chenjiahan
2020-09-15 19:37:53 +08:00
parent 1e7e7086d6
commit d659c0c99e
4 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -1,4 +1,7 @@
export function isHidden(el: HTMLElement) {
import { unref, Ref } from 'vue';
export function isHidden(elementRef: HTMLElement | Ref<HTMLElement>) {
const el = unref(elementRef);
const style = window.getComputedStyle(el);
const hidden = style.display === 'none';