edit.vue 593 B

1234567891011121314151617181920212223242526272829
  1. <!--suppress JSValidateTypes -->
  2. <template>
  3. <div>
  4. <SpinnerModal
  5. v-if="isPending"
  6. :visible="true"
  7. />
  8. <UserEditor
  9. v-else
  10. action="update"
  11. :userId="userId"
  12. :initialValue="user"
  13. />
  14. </div>
  15. </template>
  16. <script setup>
  17. definePageMeta({
  18. name: "admin:userEdit",
  19. path: "/admin/users/:userId([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
  20. middleware: ["signed-in", "admin"]
  21. })
  22. const userId = useRoute().params?.userId
  23. const { data: user, isPending } = useQuery(() => userByIdQuery(userId))
  24. </script>
  25. <style scoped></style>