perf(admin): lazy routes and nav badges
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { inject, onMounted, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
import { closeFeedback, deleteFeedback, fetchFeedbacks, replyFeedback } from '../api/feedbacks'
|
||||
|
||||
const refreshNavBadges = inject('refreshNavBadges', null)
|
||||
|
||||
const loading = ref(false)
|
||||
const statusFilter = ref('')
|
||||
const stats = ref({ total: 0, pending: 0, replied: 0, closed: 0 })
|
||||
@@ -35,6 +37,8 @@ async function load() {
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
await refreshNavBadges?.({ pendingFeedbacks: stats.value.pending || 0 })
|
||||
}
|
||||
|
||||
async function onReply(row) {
|
||||
@@ -253,4 +257,3 @@ onMounted(load)
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user