<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # ScrollContainer 參考 `element-ui` 的 el-scrollbar 組件實現 滾動容器組件 ## Usage ```vue <template> <div class="p-4"> <div class="my-4"> <a-button @click="scrollTo(100)">滾動到100px位置</a-button> <a-button @click="scrollTo(800)">滾動到800px位置</a-button> <a-button @click="scrollTo(0)">滾動到頂部</a-button> <a-button @click="scrollBottom()">滾動到底部</a-button> </div> <div class="scroll-wrap"> <ScrollContainer ref="scrollRef"> <ul> <template v-for="index in 100" :key="index"> <li>{{ index }}</li> </template> </ul> </ScrollContainer> </div> </div> </template> <script lang="ts"> import { defineComponent, ref, unref } from 'vue'; import { CollapseContainer } from '/@/components/Container/index'; import { ScrollContainer, ScrollActionType } from '/@/components/Container/index'; export default defineComponent({ components: { CollapseContainer, ScrollContainer }, setup() { const scrollRef = ref<Nullable<ScrollActionType>>(null); const getScroll = () => { const scroll = unref(scrollRef); if (!scroll) { throw new Error('scroll is Null'); } return scroll; }; function scrollTo(top: number) { getScroll()?.scrollTo(top); } function scrollBottom() { getScroll()?.scrollBottom(); } return { scrollTo, scrollRef, scrollBottom, }; }, }); </script> <style lang="less" scoped> .scroll-wrap { width: 50%; height: 300px; background: #fff; } </style> ``` ## Methods | 名稱 | 回調參數 | 說明 | | ------------- | ------------------------------------ | --------------- | | getScrollWrap | `()=>HtmlElement` | 獲取滾動容器 el | | scrollBottom | `Function` | 滾動到底部 | | scrollTo | `Function(to:number,duration = 500)` | 滾動到指定位置 | ## Slots | 名稱 | 說明 | | ------- | -------- | | default | 默認區域 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看