Ben Lin
2025-03-08 745815f637e5385b2cbc23a6ae02401bb8b6c675
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<template>
  <span :class="`${prefixCls}__extra-redo`" @click="handleRedo">
    <RedoOutlined :spin="loading" />
  </span>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import { RedoOutlined } from '@ant-design/icons-vue';
  import { useDesign } from '@/hooks/web/useDesign';
  import { useTabs } from '@/hooks/web/useTabs';
 
  defineOptions({ name: 'TabRedo' });
 
  const loading = ref(false);
 
  const { prefixCls } = useDesign('multiple-tabs-content');
  const { refreshPage } = useTabs();
 
  async function handleRedo() {
    loading.value = true;
    await refreshPage();
    setTimeout(() => {
      loading.value = false;
      // Animation execution time
    }, 1200);
  }
</script>
<style lang="less" scoped>
  span.anticon-redo {
    vertical-align: baseline !important;
  }
</style>