refactor(baTable):优化数据行侧边按钮的类型定义

This commit is contained in:
妙码生花 2023-02-27 09:39:06 +08:00
parent 223f732777
commit eb648f24d2
2 changed files with 4 additions and 3 deletions

View File

@ -62,7 +62,7 @@ const { t } = useI18n()
const tableRef = ref() const tableRef = ref()
const optBtn = defaultOptButtons(['edit', 'delete']) const optBtn = defaultOptButtons(['edit', 'delete'])
optBtn[1].popconfirm.title = t('routine.attachment.Files and records will be deleted at the same time Are you sure?') optBtn[1].popconfirm!.title = t('routine.attachment.Files and records will be deleted at the same time Are you sure?')
const baTable = new baTableClass(new baTableApi(routineAttachment), { const baTable = new baTableClass(new baTableApi(routineAttachment), {
column: [ column: [

View File

@ -3,6 +3,7 @@ import { Component, ComponentPublicInstance } from 'vue'
import Table from '/@/components/table/index.vue' import Table from '/@/components/table/index.vue'
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults' import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
import type { PopconfirmProps } from 'element-plus' import type { PopconfirmProps } from 'element-plus'
import { Mutable } from 'element-plus/es/utils'
declare global { declare global {
/* baTable */ /* baTable */
@ -200,7 +201,7 @@ declare global {
class?: string class?: string
type: ButtonType type: ButtonType
icon: string icon: string
popconfirm?: Partial<PopconfirmProps> popconfirm?: Partial<Mutable<PopconfirmProps>>
disabledTip?: boolean disabledTip?: boolean
// 自定义点击事件 // 自定义点击事件
click?: (row: TableRow, field: TableColumn) => void click?: (row: TableRow, field: TableColumn) => void
@ -209,7 +210,7 @@ declare global {
// 按钮是否禁用,请返回布尔值 // 按钮是否禁用,请返回布尔值
disabled?: (row: TableRow, field: TableColumn) => boolean disabled?: (row: TableRow, field: TableColumn) => boolean
// 自定义el-button属性 // 自定义el-button属性
attr?: Partial<ButtonProps> attr?: Partial<Mutable<ButtonProps>>
} }
/* 表格行 */ /* 表格行 */