update: keep users state

This commit is contained in:
Tony Yang
2025-03-30 02:17:18 +08:00
parent 10fe8503fb
commit 7b2857b85f
2 changed files with 3 additions and 3 deletions
+1
View File
@@ -39,6 +39,7 @@ const routes = [
name: 'Users',
component: UsersView,
meta: {
keepAlive: true,
showInNav: true,
navName: '使用者列表'
}
+2 -3
View File
@@ -1,10 +1,9 @@
<script setup>
import CreateForm from '../components/CreateUser/CreateForm.vue';
import { onMounted, ref } from 'vue';
import { onActivated, ref } from 'vue';
const users = ref([]);
onMounted(async () => {
onActivated(async () => {
const response = await fetch('/api/users');
if (!response.ok) {