/* * menu.ts * Copyright (C) 2024 veypi * 2024-06-07 17:51 * Distributed under terms of the MIT license. */ interface item { ico: string name: string path: string label?: string subs?: item[] } const default_menu = [ { 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 } }, });