mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-13 20:57:09 +08:00
feat: 优化 GiForm(同步 GiDemo 更新)
This commit is contained in:
31
src/layout/components/Tabs/ReloadIcon.vue
Normal file
31
src/layout/components/Tabs/ReloadIcon.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<icon-refresh class="reload-icon" :class="{ 'reload-icon--spin': loading }" :size="18" @click="reload" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useTabsStore } from '@/stores'
|
||||
|
||||
const tabsStore = useTabsStore()
|
||||
const loading = ref(false)
|
||||
|
||||
// 重载页面
|
||||
const reload = () => {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
tabsStore.reloadPage()
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 600)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.reload-icon {
|
||||
cursor: pointer;
|
||||
|
||||
&--spin {
|
||||
animation-name: arco-loading-circle;
|
||||
animation-duration: 0.6s;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -51,17 +51,12 @@
|
||||
</template>
|
||||
<template #default>关闭其他</template>
|
||||
</a-doption>
|
||||
<a-doption @click="tabsStore.closeAll">
|
||||
<template #icon>
|
||||
<icon-minus />
|
||||
</template>
|
||||
<template #default>关闭全部</template>
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<template #extra>
|
||||
<ReloadIcon></ReloadIcon>
|
||||
<a-dropdown trigger="hover">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
@@ -69,12 +64,6 @@
|
||||
</template>
|
||||
</a-button>
|
||||
<template #content>
|
||||
<a-doption @click="reload">
|
||||
<template #icon>
|
||||
<icon-refresh class="reload-icon" :class="{ 'reload-icon--spin': loading }" />
|
||||
</template>
|
||||
<template #default>重新加载</template>
|
||||
</a-doption>
|
||||
<a-doption @click="tabsStore.closeCurrent(route.path)">
|
||||
<template #icon>
|
||||
<icon-close />
|
||||
@@ -114,6 +103,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { RouteLocationNormalized } from 'vue-router'
|
||||
import ReloadIcon from './ReloadIcon.vue'
|
||||
import { useAppStore, useTabsStore } from '@/stores'
|
||||
|
||||
defineOptions({ name: 'Tabs' })
|
||||
|
||||
Reference in New Issue
Block a user