# useScrollTo

使元素滚动到一定的位置

## Usage

```vue
<template>
  <div ref="wrapRef" class="h-600px"> </div>
</template>
<script setup lang="ts">
  import { useScrollTo } from '@eciol/hooks';

  const wrapRef = ref();
  const { start } = useScrollTo({
    el: wrapRef,
    to: 100,
  });
  start();
</script>
```

## Type Declarations

```ts
interface UseScrollToOptions {
  /**
   * @description 需要滚动的元素
   */
  el: any;
  /**
   * @description 需要滚动的距离
   */
  to: number;
  /**
   * @description 滚动的延迟时间
   * @default 500
   */
  duration?: number;
  /**
   * @description 滚动结束的回调函数
   */
  callback?: () => any;
}
declare function useScrollTo({ el, to, duration, callback }: UseScrollToOptions): {
  /**
   * @description 开始滚动
   */
  start: () => void;
  /**
   * @description 停止滚动
   */
  stop: () => void;
};
```
