props.ts 1.3 KB
Newer Older
陈文彬 已提交
1 2 3
import type { Menu } from '/@/router/types';
import type { PropType } from 'vue';

V
vben 已提交
4 5
import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
import { ThemeEnum } from '/@/enums/appEnum';
陈文彬 已提交
6 7 8 9 10 11 12 13 14
export const basicProps = {
  items: {
    type: Array as PropType<Menu[]>,
    default: () => [],
  },
  appendClass: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
15

V
vben 已提交
16 17 18 19
  collapsedShowTitle: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
20

陈文彬 已提交
21 22 23 24 25 26 27
  // 最好是4 倍数
  inlineIndent: {
    type: Number as PropType<number>,
    default: 20,
  },
  // 菜单组件的mode属性
  mode: {
V
vben 已提交
28
    type: String as PropType<MenuModeEnum>,
陈文彬 已提交
29 30
    default: MenuModeEnum.INLINE,
  },
V
vben 已提交
31 32 33 34
  showLogo: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
陈文彬 已提交
35 36 37 38 39 40
  type: {
    type: String as PropType<MenuTypeEnum>,
    default: MenuTypeEnum.MIX,
  },
  theme: {
    type: String as PropType<string>,
V
vben 已提交
41
    default: ThemeEnum.DARK,
陈文彬 已提交
42 43 44 45 46
  },
  inlineCollapsed: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
47

V
vben 已提交
48
  isHorizontal: {
V
vben 已提交
49 50 51
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
52 53 54 55
  accordion: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
陈文彬 已提交
56
  beforeClickFn: {
V
vben 已提交
57
    type: Function as PropType<(key: string) => Promise<boolean>>,
陈文彬 已提交
58 59
  },
};