| | |
| | | import {onMounted, reactive, ref} from "vue" |
| | | import {useRoute} from "vue-router" |
| | | import Pagination from "../components/Pagination.vue" |
| | | import {getUsers} from "@/lib/api" |
| | | import {getUsers, routerBase} from "@/lib/api" |
| | | import {useRouteQuery} from '@vueuse/router' |
| | | import {onKeyStroke} from "@vueuse/core" |
| | | |
| | | const route = useRoute() |
| | | const userId = route.params.userId |
| | |
| | | data: [], |
| | | }) |
| | | const offset = useRouteQuery("offset", 0, {transform: Number}) |
| | | const limit = 24 |
| | | const limit = 22 |
| | | const error = ref(null) |
| | | |
| | | onMounted(() => init(offset.value)) |
| | |
| | | return init(offset) |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | |
| | | <div class="users"> |
| | | |
| | | <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" /> |
| | | <div class="users-header"> |
| | | <div class="search"> |
| | | Search |
| | | <input type="text" size="30"> |
| | | </div> |
| | | <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" /> |
| | | </div> |
| | | |
| | | <table class="w100p"> |
| | | <thead> |
| | |
| | | <tbody> |
| | | <tr v-for="user in users.data"> |
| | | <td> |
| | | <RouterLink :to="`/ui/user/${user.usr_id}`"> |
| | | <RouterLink :to="`${routerBase}/ui/user/${user.usr_id}`"> |
| | | {{ user.usr_id }} |
| | | </RouterLink> |
| | | </td> |
| | |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | <style scoped lang="stylus"> |
| | | |
| | | .users-header |
| | | display flex; |
| | | align-items center |
| | | justify-content space-around |
| | | margin-bottom 1em; |
| | | margin-top -.5em; |
| | | border 1px dotted #ccc |
| | | background-color #eee; |
| | | |
| | | </style> |