perf: 调整
This commit is contained in:
@ -9,12 +9,12 @@
|
||||
@cancel="onClose"
|
||||
centered
|
||||
>
|
||||
<Tabs :activeKey="activeTab" @change="handleTabClick">
|
||||
<TabPane key="0" tab="导入"> </TabPane>
|
||||
<TabPane key="1" tab="导出"> </TabPane>
|
||||
<Tabs v-model:activeKey="activeTab" @change="handleTabClick">
|
||||
<TabPane key="1" tab="导入"> </TabPane>
|
||||
<TabPane key="2" tab="导出"> </TabPane>
|
||||
</Tabs>
|
||||
<div class="content">
|
||||
<component :is="activeTab === '0' ? ImportTask : ExportTask" ref="componentRef" />
|
||||
<component :is="activeTab === '1' ? ImportTask : ExportTask" ref="componentRef" />
|
||||
</div>
|
||||
</Modal>
|
||||
</template>
|
||||
@ -28,12 +28,12 @@ import ImportTask from './components/import-task';
|
||||
|
||||
const visible = ref(false);
|
||||
const componentRef = ref(null);
|
||||
const activeTab = ref('0');
|
||||
const activeTab = ref('1');
|
||||
|
||||
let timer = null;
|
||||
|
||||
const handleTabClick = (key) => {
|
||||
activeTab.value = key;
|
||||
// activeTab.value = key;
|
||||
nextTick(() => {
|
||||
getData();
|
||||
});
|
||||
@ -44,13 +44,14 @@ const getData = () => {
|
||||
};
|
||||
|
||||
const open = () => {
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
getData();
|
||||
});
|
||||
|
||||
timer = setInterval(() => {
|
||||
getData();
|
||||
}, 10000);
|
||||
|
||||
visible.value = true;
|
||||
};
|
||||
const onClose = () => {
|
||||
activeTab.value = '0';
|
||||
|
||||
Reference in New Issue
Block a user