| 1234567891011121314151617181920212223242526272829303132 |
- import {ItemMenu} from "~/types/types";
- class BaseMenu{
- private $config:any;
- constructor($config:any) {
- this.$config = $config;
- }
- /**
- * Construit un ItemMenu
- * @param {string} icon
- * @param {string} title titre qui sera traduit
- * @param {string} link lien
- * @param {boolean} isOldLink est-ce un lien renvoyant vers l'ancien admin ?
- * @param {Array<ItemMenu>} children Tableau d'ItemMenu représentant les sous menu du menu principal
- * @return {ItemMenu}
- */
- constructMenu(icon: string, title: string, link?: string, isOldLink?: boolean, children?: Array<ItemMenu>): ItemMenu{
- return children ? {
- icon: icon,
- title: title,
- children: children,
- } : {
- icon: icon,
- title: title,
- to: `${isOldLink ? this.$config.baseURL_adminLegacy : ''}${link}`,
- old: isOldLink,
- }
- }
- }
- export default BaseMenu;
|