chore: keepAlive测试
This commit is contained in:
parent
75689766e7
commit
ac7e7beeda
@ -1,17 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
import { Button, Card } from 'ant-design-vue';
|
||||
|
||||
onMounted(() => {
|
||||
console.log('keepAlive测试 -> 挂载了');
|
||||
});
|
||||
|
||||
const count = ref(0);
|
||||
let intervalId: number = 0;
|
||||
|
||||
onMounted(() => {
|
||||
intervalId = setInterval(() => {
|
||||
count.value++;
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => intervalId && clearInterval(intervalId));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="m-[8px]">
|
||||
<Button type="primary" v-access:code="['system:user:list']">
|
||||
测试按钮可见
|
||||
</Button>
|
||||
<Card title="测试keepAlive">
|
||||
<template #extra>
|
||||
<Button type="primary" v-access:code="['system:user:list']">
|
||||
测试按钮权限system:user:list
|
||||
</Button>
|
||||
</template>
|
||||
<p>当前计数: {{ count }}</p>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user