From ebbd788fbb2c0b45d4473798efc57eec8ba74a25 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 18 六月 2024 14:51:16 +0800 Subject: [PATCH] 版本更新至2.11.5 --- src/views/demo/comp/scroll/Action.vue | 47 +++++++++++++++++++---------------------------- 1 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/views/demo/comp/scroll/Action.vue b/src/views/demo/comp/scroll/Action.vue index 78148a1..8bf2a4a 100644 --- a/src/views/demo/comp/scroll/Action.vue +++ b/src/views/demo/comp/scroll/Action.vue @@ -19,36 +19,27 @@ </div> </PageWrapper> </template> -<script lang="ts"> - import { defineComponent, ref, unref } from 'vue'; - import { ScrollContainer, ScrollActionType } from '/@/components/Container/index'; - import { PageWrapper } from '/@/components/Page'; +<script lang="ts" setup> + import { ref, unref } from 'vue'; + import { ScrollContainer, ScrollActionType } from '@/components/Container'; + import { PageWrapper } from '@/components/Page'; + import { type Nullable } from '@vben/types'; - export default defineComponent({ - components: { ScrollContainer, PageWrapper }, - setup() { - const scrollRef = ref<Nullable<ScrollActionType>>(null); - const getScroll = () => { - const scroll = unref(scrollRef); - if (!scroll) { - throw new Error('scroll is Null'); - } - return scroll; - }; + 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, - }; - }, - }); + function scrollTo(top: number) { + getScroll().scrollTo(top); + } + function scrollBottom() { + getScroll().scrollBottom(); + } </script> <style lang="less" scoped> .scroll-wrap { -- Gitblit v1.9.3