改进 路由

This commit is contained in:
iVampireSP.com 2023-12-07 14:34:10 +08:00
parent b52d4c7152
commit bc0db5a5be
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 14 additions and 6 deletions

View File

@ -20,16 +20,17 @@ const routes = [
name: "login",
component: () => import("@/views/auth/Login.vue"),
},
{
path: "/documents",
name: "documents",
component: () => import("@/views/documents/List.vue"),
},
{
path: "/libraries",
name: "libraries",
component: () => import("@/views/libraries/List.vue"),
},
{
path: "/library/:LibraryId/documents",
name: "library.documents",
component: () => import("@/views/documents/List.vue"),
}
];
const router = createRouter({

View File

@ -73,6 +73,7 @@
:length="libraries.Total"
:disabled="loading"
@update:model-value="load"
next-icon
></v-pagination>
</v-container>
</v-col>
@ -85,6 +86,7 @@
import { library } from "@/plugins/api";
import { ref } from "vue";
import LoadingComponent from "@/components/Loading.vue";
import router from "@/router";
const loading = ref(false);
@ -117,7 +119,12 @@ const load = (show_load = true) => {
load();
const goto = (libraryId) => {
console.log(libraryId);
router.push({
name: "library.documents",
params: {
LibraryId: libraryId
}
})
};
function isSelected(id) {