收藏主机.

This commit is contained in:
lijiahang
2023-09-14 16:18:41 +08:00
parent 08f9b9410b
commit f8b694c16a
13 changed files with 386 additions and 74 deletions

View File

@@ -2,12 +2,12 @@
<div class="layout-container">
<!-- 表格 -->
<host-table ref="table"
@openAdd="() => modal.openAdd()"
@openUpdate="(e) => modal.openUpdate(e)" />
@openAdd="() => modal.openAdd()"
@openUpdate="(e) => modal.openUpdate(e)" />
<!-- 添加修改模态框 -->
<host-form-modal ref="modal"
@added="() => table.addedCallback()"
@updated="() => table.updatedCallback()" />
@added="() => table.addedCallback()"
@updated="() => table.updatedCallback()" />
</div>
</template>
@@ -20,11 +20,18 @@
<script lang="ts" setup>
import HostTable from './components/host-table.vue';
import HostFormModal from './components/host-form-modal.vue';
import { ref } from 'vue';
import { onUnmounted, ref } from 'vue';
import { useCacheStore } from '@/store';
const table = ref();
const modal = ref();
// 卸载时清除 tags cache
onUnmounted(() => {
const cacheStore = useCacheStore();
cacheStore.set('tags', []);
});
</script>
<style lang="less" scoped>