|
1
|
<template>
|
vben
authored
|
2
|
<PageWrapper title="标签页操作示例">
|
nebv
authored
|
3
|
<CollapseContainer title="在下面输入框输入文本,切换后回来内容会保存">
|
|
4
5
6
|
<a-input placeholder="请输入" />
</CollapseContainer>
|
vben
authored
|
7
|
<CollapseContainer class="mt-4" title="标签页操作">
|
vben
authored
|
8
9
10
11
12
13
|
<a-button class="mr-2" @click="closeAll"> 关闭所有 </a-button>
<a-button class="mr-2" @click="closeLeft"> 关闭左侧 </a-button>
<a-button class="mr-2" @click="closeRight"> 关闭右侧 </a-button>
<a-button class="mr-2" @click="closeOther"> 关闭其他 </a-button>
<a-button class="mr-2" @click="closeCurrent"> 关闭当前 </a-button>
<a-button class="mr-2" @click="refreshPage"> 刷新当前 </a-button>
|
|
14
|
</CollapseContainer>
|
vben
authored
|
15
|
</PageWrapper>
|
|
16
17
18
19
20
|
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { CollapseContainer } from '/@/components/Container/index';
import { useTabs } from '/@/hooks/web/useTabs';
|
vben
authored
|
21
|
import { PageWrapper } from '/@/components/Page';
|
vben
authored
|
22
23
|
import { Input } from 'ant-design-vue';
|
|
24
25
|
export default defineComponent({
name: 'TabsDemo',
|
vben
authored
|
26
|
components: { CollapseContainer, PageWrapper, [Input.name]: Input },
|
|
27
|
setup() {
|
vben
authored
|
28
|
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTabs();
|
vben
authored
|
29
30
31
32
33
34
35
36
37
|
return {
closeAll,
closeLeft,
closeRight,
closeOther,
closeCurrent,
refreshPage,
};
|
|
38
39
40
|
},
});
</script>
|