reka-ui
Version:
Vue port for Radix UI Primitives.
21 lines (18 loc) • 433 B
JavaScript
import { unrefElement } from '@vueuse/core';
import { hideOthers } from 'aria-hidden';
import { watch, onUnmounted } from 'vue';
function useHideOthers(target) {
let undo;
watch(() => unrefElement(target), (el) => {
if (el)
undo = hideOthers(el);
else if (undo)
undo();
});
onUnmounted(() => {
if (undo)
undo();
});
}
export { useHideOthers as u };
//# sourceMappingURL=useHideOthers.js.map