feat(prop): 隐藏操作列

This commit is contained in:
2023-07-22 15:52:26 +08:00
parent 8b3794aae6
commit d241e51221
3 changed files with 6 additions and 3 deletions

View File

@ -30,7 +30,7 @@
/>
</template>
</el-table-column>
<el-table-column align="center" :label="label3" width="200px">
<el-table-column v-if="!hideActions" align="center" :label="label3" width="200px">
<template #default="{ row, $index }">
<el-popconfirm v-if="allowReplace" :title="replacePopconfirm" :disabled="disabled" @confirm="remove($index)">
<template #reference>
@ -96,6 +96,8 @@ const props = withDefaults(defineProps<{
disabled?: boolean
/** 隐藏新增按钮 */
hideAdd?: boolean
/** 隐藏操作列 */
hideActions?: boolean
/** 文件上传的请求函数 */
request?: (formData: FormData) => Promise<FileVO>
}>(), {

View File

@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-07-18 12:23:37
* @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-07-21 21:45:15
* @LastEditTime: 2023-07-22 15:51:39
* @FilePath: \vue3\stories\UploadTable.stories.ts
* @Description:
*
@ -42,6 +42,7 @@ const meta = {
args: {
accept: '.jpeg,.jpg,.png,.bmp',
addText: '新增一行',
hideActions: false,
allowDelete: true,
allowReplace: false,
disabled: false,
@ -68,6 +69,7 @@ const meta = {
:allow-delete="args.allowDelete"
:allow-replace="args.allowReplace"
:hide-add="args.hideAdd"
:hide-actions="args.hideActions"
:label1="args.label1"
:label2="args.label2"
:label3="args.label3"

View File

@ -13,7 +13,6 @@ declare module 'vue' {
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']