We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
方便外部控制冻结列
以下个人业务中实现
frozenColConfig?: { leftField: string; rightField: string; };
export const columnsToList = ( columns: VTableOptions['columns'], parentField?: string, ): VTableOptions['columns'] => { const result: VTableOptions['columns'] = []; cloneDeep(columns!).forEach((column) => { if (column.columns && column.columns.length) { result.push( ...(columnsToList( column.columns, parentField ? `${parentField}.${column.field}` : column.field, ) ?? []), ); } else { if (parentField) { column.field = `${parentField}.${column.field}`; } result.push(column); } }); return result; }; export const getFrozenColCount = ( options: VTableOptions, columns: VTableOptions['columns'], frozenColCount = 0, rightFrozenColCount = 0, ): { frozenColCount: number; rightFrozenColCount: number; } => { const { leftField = 'isCheck', rightField = '' } = options.frozenColConfig ?? {}; const columnsList = columnsToList(columns ?? []); const leftFrozenColCount = columnsList!.findIndex((column) => column.field === leftField) + 1; const _rightFrozenColCount = columnsList!.reverse().findIndex((column) => column.field === rightField) + 1; if (leftFrozenColCount !== -1) { frozenColCount += leftFrozenColCount; } if (rightFrozenColCount !== -1) { rightFrozenColCount += _rightFrozenColCount; } return { frozenColCount, rightFrozenColCount, }; };
The text was updated successfully, but these errors were encountered:
收到。可能最近没有时间安排这个需求。 可以暂时使用frozenColCount来实现 。 调整好columns中的顺序 需要冻结的放到前面
Sorry, something went wrong.
No branches or pull requests
What problem does this feature solve?
方便外部控制冻结列
What does the proposed API look like?
以下个人业务中实现
The text was updated successfully, but these errors were encountered: