mirror of
https://gitee.com/xuliangzhan_admin/vxe-table.git
synced 2026-01-21 05:27:57 +08:00
优化 setEditRow 方法支持指定列
This commit is contained in:
@@ -574,9 +574,13 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
||||
/**
|
||||
* 激活行编辑
|
||||
*/
|
||||
setEditRow (row) {
|
||||
setEditRow (row, fieldOrColumn) {
|
||||
const { visibleColumn } = internalData
|
||||
return $xetable.setEditCell(row, XEUtils.find(visibleColumn, column => isEnableConf(column.editRender)))
|
||||
let column: any = XEUtils.find(visibleColumn, column => isEnableConf(column.editRender))
|
||||
if (fieldOrColumn) {
|
||||
column = XEUtils.isString(fieldOrColumn) ? $xetable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
||||
}
|
||||
return $xetable.setEditCell(row, column)
|
||||
},
|
||||
setActiveCell (row, fieldOrColumn) {
|
||||
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
||||
|
||||
@@ -6,7 +6,8 @@ export default defineComponent({
|
||||
name: 'VxeIcon',
|
||||
props: {
|
||||
name: String as PropType<VxeIconPropTypes.Name>,
|
||||
roll: Boolean as PropType<VxeIconPropTypes.Roll>
|
||||
roll: Boolean as PropType<VxeIconPropTypes.Roll>,
|
||||
status: String as PropType<VxeIconPropTypes.Status>
|
||||
},
|
||||
emits: [
|
||||
'click'
|
||||
|
||||
4
types/edit.d.ts
vendored
4
types/edit.d.ts
vendored
@@ -135,10 +135,10 @@ export interface TableEditMethods<D = VxeTableDataRow> {
|
||||
*/
|
||||
setActiveRow(row: any): Promise<void>
|
||||
/**
|
||||
* 用于 edit-config,激活行编辑并激活第一个单元格
|
||||
* 用于 edit-config,激活行编辑并默认激活第一个列,也可以指定列
|
||||
* @param row 指定行
|
||||
*/
|
||||
setEditRow(row: any): Promise<void>
|
||||
setEditRow(row: any, fieldOrColumn?: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
||||
/**
|
||||
* 请使用 setEditCell
|
||||
* @deprecated
|
||||
|
||||
2
types/icon.d.ts
vendored
2
types/icon.d.ts
vendored
@@ -25,11 +25,13 @@ export interface VxeIconMethods extends IconMethods { }
|
||||
export type VxeIconProps<D = any> = {
|
||||
name?: VxeIconPropTypes.Name
|
||||
roll?: VxeIconPropTypes.Roll
|
||||
status?: VxeIconPropTypes.Status
|
||||
}
|
||||
|
||||
export namespace VxeIconPropTypes {
|
||||
export type Name = string
|
||||
export type Roll = boolean
|
||||
export type Status = string
|
||||
}
|
||||
|
||||
export type VxeIconEmits = [
|
||||
|
||||
Reference in New Issue
Block a user