You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oaweb/stores/menu.ts

40 lines
819 B
TypeScript

/*
* menu.ts
* Copyright (C) 2024 veypi <i@veypi.com>
* 2024-06-07 17:51
* Distributed under terms of the MIT license.
*/
interface item {
ico: string
3 weeks ago
name: string
path: string
label?: string
subs?: item[]
}
3 weeks ago
const default_menu: item[] = [
// { ico: 'home', name: 'menu.app', path: '/' },
// { ico: 'user', name: 'menu.user', path: '/user' },
// { ico: 'file-exception', name: 'menu.doc', path: '/docs' },
// { ico: 'data-view', name: 'menu.appstat', path: '/stats' },
// { ico: 'setting', name: 'menu.setting', path: '/setting' },
]
export const useMenuStore = defineStore('menu', {
state: () => ({
menus: default_menu as item[]
}),
getters: {
},
actions: {
set(list: item[]) {
this.menus = list
},
default() {
this.menus = default_menu
}
},
});