Full CRUD for publications; link fruits to publications; upload per-fruit PDF descriptions and fruit images stored as BYTEA; fruit detail page shows publication descriptions and images. ImageOverlayDrawer for cover thumbnail full-size view. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
import HelloWorld from '../views/HelloWorld.vue'
|
|
import FruitList from '../views/FruitList.vue'
|
|
import FruitCreate from '../views/FruitCreate.vue'
|
|
import FruitDetail from '../views/FruitDetail.vue'
|
|
import PublicationList from '../views/PublicationList.vue'
|
|
import PublicationCreate from '../views/PublicationCreate.vue'
|
|
import PublicationDetail from '../views/PublicationDetail.vue'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
component: HelloWorld,
|
|
},
|
|
{
|
|
path: '/fruits',
|
|
component: FruitList,
|
|
},
|
|
{
|
|
// /fruits/new must come before /:id so vue-router v5 doesn't capture "new" as a param
|
|
path: '/fruits/new',
|
|
component: FruitCreate,
|
|
},
|
|
{
|
|
path: '/fruits/:id',
|
|
component: FruitDetail,
|
|
props: true,
|
|
},
|
|
{
|
|
path: '/publications',
|
|
component: PublicationList,
|
|
},
|
|
{
|
|
// /publications/new must come before /:id
|
|
path: '/publications/new',
|
|
component: PublicationCreate,
|
|
},
|
|
{
|
|
path: '/publications/:id',
|
|
component: PublicationDetail,
|
|
props: true,
|
|
},
|
|
],
|
|
})
|
|
|
|
export default router
|