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', name: 'Users',
component: UsersView, component: UsersView,
meta: { meta: {
keepAlive: true,
showInNav: true, showInNav: true,
navName: '使用者列表' navName: '使用者列表'
} }
+2 -3
View File
@@ -1,10 +1,9 @@
<script setup> <script setup>
import CreateForm from '../components/CreateUser/CreateForm.vue'; import { onActivated, ref } from 'vue';
import { onMounted, ref } from 'vue';
const users = ref([]); const users = ref([]);
onMounted(async () => { onActivated(async () => {
const response = await fetch('/api/users'); const response = await fetch('/api/users');
if (!response.ok) { if (!response.ok) {