ts: add vue-router custom RouteMeta types

This commit is contained in:
axolotle 2024-07-29 14:01:01 +02:00
parent 49cfe93a67
commit 144b276ff6
2 changed files with 15 additions and 8 deletions

11
app/overrides.d.ts vendored
View file

@ -1,6 +1,17 @@
import 'vue-router'
declare module 'vuex' {
export * from 'vuex/types/index.d.ts'
export * from 'vuex/types/helpers.d.ts'
export * from 'vuex/types/logger.d.ts'
export * from 'vuex/types/vue.d.ts'
}
declare module 'vue-router' {
interface RouteMeta {
noAuth?: boolean
routerParams?: string[]
args: { trad?: string; param?: string }
breadcrumb?: string[]
}
}

View file

@ -1,18 +1,14 @@
/**
* routes module.
* @module router/routes
*/
// Simple views are normally imported and will be included into the main webpack entry.
// Others will be chunked by webpack so they can be lazy loaded.
// Webpack chunk syntax is:
// Others will be chunked so they can be lazy loaded:
// `() => import('@/views/:ViewComponent.vue')`
import type { RouteRecordRaw } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import ToolList from '@/views/tool/ToolList.vue'
const routes = [
const routes: RouteRecordRaw[] = [
{
name: 'home',
path: '/',