ots/src/router.js
Knut Ahlers 8c0807d486
Port frontend to Bootstrap 5.3, split components
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-09-30 23:18:34 +02:00

46 lines
1.0 KiB
JavaScript

import AppCreate from './components/create.vue'
import AppDisplayURL from './components/display-url.vue'
import AppExplanation from './components/explanation.vue'
import AppSecretDisplay from './components/secret-display.vue'
import VueRouter from 'vue-router'
const routes = [
{
component: AppCreate,
name: 'create',
path: '/',
},
{
component: AppDisplayURL,
name: 'display-secret-url',
path: '/display-secret-url',
props: route => ({
expiresAt: route.query.expiresAt ? new Date(route.query.expiresAt) : null,
secretId: route.query.secretId,
securePassword: route.query.securePassword,
}),
},
{
component: AppExplanation,
name: 'explanation',
path: '/explanation',
},
{
component: AppSecretDisplay,
name: 'secret',
path: '/secret',
props: route => ({
secretId: route.query.secretId,
securePassword: route.query.securePassword,
}),
},
]
const router = new VueRouter({
mode: 'abstract',
routes,
})
export default router