UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

24 lines (20 loc) 589 B
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { elementInViewport, getWindowSize, scrollTo } from '../../utils/dom.js'; import '../../_chunks/dep-3a1cce9f.js'; import 'lodash/isString'; import 'lodash/isFunction'; import 'lodash/isArray'; import '../../utils/easing.js'; function scrollToElm(elm) { var rect = elm.getBoundingClientRect(); if (!elementInViewport(elm)) { var winHeight = getWindowSize().height; scrollTo(rect.top - (winHeight / 2 - rect.height / 2), {}); } } export { scrollToElm as default }; //# sourceMappingURL=scrollToElm.js.map