OperatBtns
适用于表格可下拉操作按钮。
- 内置权限处理
如何使用
vue
<script setup lang="ts">
const btns = [
{
label: '编辑',
// permission: ['WMS.Function.ShelfManagementEditor', 'WMS.Function.ShelfManagementStatus'],
},
{
label: '审核',
// permission: 'WMS.Function.BaseLogOperationRecords',
},
{
label: '转移',
},
{
label: '封存',
},
{
label: '禁用',
},
{
label: '下架',
props: {
danger: true,
},
},
]
</script>
<template>
<OperatBtns :btns="btns" />
</template>
代码演示
基本使用
<script setup lang="ts">
const btns = [
{
label: '编辑',
// permission: ['WMS.Function.ShelfManagementEditor', 'WMS.Function.ShelfManagementStatus'],
},
{
label: '审核',
// permission: 'WMS.Function.BaseLogOperationRecords',
},
{
label: '转移',
},
{
label: '封存',
},
{
label: '禁用',
},
{
label: '下架',
props: {
danger: true,
},
},
]
</script>
<template>
<div>
<f-space direction="vertical">
<OperatBtns :btns="btns" />
<OperatBtns :btns="btns" :max="4" />
</f-space>
</div>
</template>
API
参数 | 说明 | 类型 | 默认值 | 版本 |
---|---|---|---|---|
btns | 按钮组 | IOperatBtnsProps[] | - | - |
max | 展示数量 | number | 2 | - |
size | 边距 | number | 12 | - |
more | 展开字段 | string | 更多 | - |
ts
export interface IOperatBtn {
label: string
key?: string
permission?: string | string[] // 权限模型
props?: Record<string, any> // AButton props
}
export interface IOperatBtnsProps {
max?: number
size?: number // 编剧
more?: string
btns: IOperatBtn[]
}