0.3.19 • Published 1 year ago

@ljweb/layout-antdv v0.3.19

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@ljweb/layout-antdv

LayoutAdmin 组件

管理端页面级整体布局。

Props

参数类型默认值说明
logostring| slot-图标
titlestring| slot-标题
menusMenuConfig[][]左侧菜单
layoutTypesidermenu|topmenu | mixedmenumixedmenu布局类型。sidermenu: 显示在 Sider不显示 Header。topmenu:显示在 Header不显示 Sider。mixedmenu: menu.position 为 top 显示在 Header, 否则显示在 Sider
contentWidthfluid| fixedfluid内容显示宽度。fluid:100% 宽度。fixed:固定宽度
fixedHeaderbooleantrue固定 Header
fixSiderbarbooleantrue固定 Siderbar
autoHideHeaderbooleanfalse向下滚动时隐藏 Header
sideCollapsedboolean | auto | disabledauto折叠方式 boolean 时,初始化折叠状态 auto 时,根据页面宽度展开/折叠 disabled: 不折叠
sideCollapsedMouseAnimationDisabledbooleanfalse鼠标动画禁用
menuTriggerImmediatelybooleantrue点击立即切换页面
loadingbooleanfalse显示 loading
loadingTextstringLoading...loading 文字
prefixClsstring-样式名称前缀
i18nKeyPrefixstringcomponents.layout_admin多语言 key 前缀
onInitRouteChangeFunction(callback: (path: string) => void) => void初始化路由变更监听

事件

名称回调参数说明
menuClickFunction({ path: string, resolved: { path: string; resolved: boolean } })菜单点击事件

LayoutAdmin.BreadcrumbProvider

提供路由面包屑数据给 BreadcrumbContainer 使用

Props

参数类型默认值说明
breadcrumbBreadcrumbConfig[]-面包屑(必须)

LayoutAdmin.BreadcrumbContainer

面包屑容器 如果嵌套使用时,只显示最外层的面包屑

Props

参数类型默认值说明
breadcrumbboolean | PresetBreadcrumbItem[] | ((routeBreadcrumbs: BreadcrumbConfig[]) => Exclude<PresetBreadcrumbItem, String>[])true传入的面包屑数据, 默认值:true;当为 true 时,使用路由的面包屑数据;当为 false 时,不显示面包屑

MenuConfigType

参数类型默认值说明
keystring-唯一标识
titlestring-标题
pathstring-跳转地址
redirectstring-重定向地址
iconany-svg格式地址或antd icon
target_blank | _self-跳转方式。_self: 当前标签页打开。_blank:新标签页打开
positiontop | side | sub-菜单位置。top:一级菜单。side:二级菜单。sub:三级菜单
displaybooleanfalse菜单中不显示
breadcrumbbooleanfalse面包屑不显示

PresetBreadcrumbItem

type PresetBreadcrumbItem = BreadcrumbConfig | DefineComponent<any> | '_route'

BreadcrumbConfigType

参数类型默认值说明
keystring-唯一标识
pathstring-跳转地址
labelstring-名称

AsyncTable

表格组件

Props

参数类型默认值说明
columnsColumn[]-表格列的配置描述(必须)
dataSource(filter: { page: number;size: number;sortField?: string;sortOrder?: 'ASC' | 'DESC';}) => PagedDataSource | Promise\-数据源(必须)
rowsFieldNamestringrowsdataSource 返回数据字段
totolFieldNamestringtotaldataSource 返回行数字段
pageNumnumber1页数
pageSizenumber10页大小
showSizeChangerbooleantrue页大小是否可改变
showPagination'auto' | booleanauto显示分页
pageURIbooleanfalse启用分页 URI 模式。例如: /users/1 /users?pageNoKey=1
pageNoKeystringpageURI 模式下显示分页 current 的 key
pageSizeKeystringsizeURI 模式下显示分页 size 的 key
alert{show:boolean; clear: (() => void) | true;} | booleanfalse显示汇总(column 配置 needTotal) 例如:{ show: true, clear: Function | true } | true
i18nKeyPrefixstringcomponents.async_table多语言 key 前缀

PagedDataSourceTypes

参数类型默认值说明
rowsany[]-列表数据集合
totalnumber-列表数据总条数

SearchForm

表格数据操作相关 Form 组件(包括搜索、筛选、批量操作、总数等)

Props

参数类型默认值说明
prefixClsstring-组件样式名前缀
keywordPlaceholderstring-关键字筛选输入框占位符
keywordNamestringkeyword关键字名字,显示到 URI query 中的 key
keywordTypeOptionsArray\<{ label: string; value: string | number; default?: true }>-关键字类型下拉框选项
keywordTypeNamestringkeywordType关键字类型名字,显示 URI query 中的 key
statusNamestringstatus状态名字,显示到 URI query 中的 key
statusOptionsStatusOption[]-左上角状态搜索链接配置
keepStatusShownbooleanfalse一直显示所有状态(statusOptions 中的配置会抵消),默认:count > 0 的时候才显示
bulkAcitonOptions{value: string | number;label: string;}[]-批量操作,如果没有选项则不显示
bulkApplyingboolean-apply 按纽 loading 状态
rowCountnumber-dataSource 行数(显示在表格的右上角), 当 >0 时显示批量操作, 当 scopedSlots.filterRight 有设置时,右上角行数不显示
i18nKeyPrefixstringcomponents.search_form多语言 key 前缀

StatusOptionTypes

参数类型默认值说明
valuestring | number | undefined | Record<string, string | number>-状态值
labelstring-状态名称
countnumber-数量
tooltipstring-气泡提示内容
keepStatusShownbooleanfalse一直显示当前状态(option.keepStatusShown, prop.keepStatusShown, count > 0 任一条件满足即显示)

AvatarDropdown

头像下拉菜单

Props

参数类型默认值说明
namestring-显示名
srcstring-头像图片路径
avatarPropsOmit\<OmitVue\, 'src'>-头像大小(AvatarProps 内容详见 antdv Avatar 组件)
avatarColorstring#fff当没有头像图片但有用户名(显示用户名第一个字母),显示的文字颜色
avatarBackgroundColorstring#f67280当没有头像图片但有用户名(显示用户名第一个字母),显示的背景色
popoverDisabledbooleanfalse禁用 Popover 显示
prefixClsstring-组件样式名前缀
i18nKeyPrefixstringcomponents.avatar_dropdown多语言 key 前缀

Breadcrumb

面包屑

Props

参数类型默认值说明
itemsArray\<BreadcrumbItem | DefineComponent\>-设置 null, 将会根据$route 变化生成,如需传自定义参数,初始值必须设置成数组
i18nKeyPrefixstringcomponents.breadcrumb多语言 key 前缀

BreadcrumbItemTypes

参数类型默认值说明
labelstring-名称
tostring-跳转地址
isLinkboolean-作为链接展示
0.3.19

1 year ago

0.3.18

1 year ago

0.3.9

2 years ago

0.3.17

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.4-alpha

2 years ago

0.2.3-alpha

2 years ago

0.2.2-alpha

2 years ago

0.2.1-alpha

2 years ago

0.2.0-alpha

2 years ago

0.1.0-alpha

2 years ago