chore(@vant/use): export types

This commit is contained in:
chenjiahan
2020-10-06 09:49:17 +08:00
parent 7966183af1
commit b541226cdc
5 changed files with 15 additions and 15 deletions

View File

@@ -1,9 +1,9 @@
export { useRect } from './useRect';
export { useToggle } from './useToggle';
export { useClickAway } from './useClickAway';
export { useWindowSize } from './useWindowSize';
export { useScrollParent } from './useScrollParent';
export { useEventListener } from './useEventListener';
export { usePageVisibility } from './usePageVisibility';
export { useParent, useChildren } from './useRelation';
export * from './useRect';
export * from './useToggle';
export * from './useClickAway';
export * from './useWindowSize';
export * from './useScrollParent';
export * from './useEventListener';
export * from './usePageVisibility';
export * from './useRelation';
export * from './utils';

View File

@@ -28,7 +28,7 @@ const MINUTE = 60 * SECOND;
const HOUR = 60 * MINUTE;
const DAY = 24 * HOUR;
export function parseTime(time: number): CurrentTime {
function parseTime(time: number): CurrentTime {
const days = Math.floor(time / DAY);
const hours = Math.floor((time % DAY) / HOUR);
const minutes = Math.floor((time % HOUR) / MINUTE);

View File

@@ -11,7 +11,7 @@ function isElement(node: Element) {
// http://w3help.org/zh-cn/causes/SD9013
// http://stackoverflow.com/questions/17016740/onscroll-function-is-not-working-for-chrome
export function getScrollParent(el: Element, root: ScrollElement = window) {
function getScrollParent(el: Element, root: ScrollElement = window) {
let node = el;
while (node && node !== root && isElement(node)) {