props.ts 1.5 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
export const basicProps = {
  items: {
    type: Array as PropType<Menu[]>,
    default: () => [],
  },
V
vben 已提交
11 12 13 14
  flatItems: {
    type: Array as PropType<Menu[]>,
    default: () => [],
  },
陈文彬 已提交
15 16 17 18
  appendClass: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
19 20 21 22
  collapsedShowTitle: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
陈文彬 已提交
23 24 25 26 27 28 29 30 31 32 33 34
  // 是否显示搜索框
  search: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
  // 最好是4 倍数
  inlineIndent: {
    type: Number as PropType<number>,
    default: 20,
  },
  // 菜单组件的mode属性
  mode: {
V
vben 已提交
35
    type: String as PropType<MenuModeEnum>,
陈文彬 已提交
36 37 38 39 40 41 42 43
    default: MenuModeEnum.INLINE,
  },
  type: {
    type: String as PropType<MenuTypeEnum>,
    default: MenuTypeEnum.MIX,
  },
  theme: {
    type: String as PropType<string>,
V
vben 已提交
44
    default: ThemeEnum.DARK,
陈文彬 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57
  },
  showLogo: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
  inlineCollapsed: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
  isAppMenu: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
V
vben 已提交
58
  isHorizontal: {
V
vben 已提交
59 60 61
    type: Boolean as PropType<boolean>,
    default: false,
  },
V
vben 已提交
62 63 64 65
  accordion: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
陈文彬 已提交
66 67 68 69 70
  beforeClickFn: {
    type: Function as PropType<Fn>,
    default: null,
  },
};