Skip to content

Commit

Permalink
fix: 优化 belongsCell 类型提示
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Jun 21, 2024
1 parent f91dc4a commit 8ec830e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/s2-core/src/cell/header-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@ export abstract class HeaderCell<
// 为什么有排序参数就不展示 actionIcon 了?背景不清楚,先照旧处理
if (this.showSortIcon()) {
this.actionIconConfig = {
icons: [{ name: get(sortParam, 'type', 'none'), position: 'right' }],
belongsCell: this.cellType,
icons: [
{
name: sortParam?.type || 'none',
position: 'right',
},
],
belongsCell: this
.cellType as InternalFullyHeaderActionIcon['belongsCell'],
isSortIcon: true,
};
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/common/interface/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export interface HeaderActionIcon extends HeaderActionIconBaseOptions {
* 所属的 cell 类型, 即当前 icon 展示在哪种类型单元格中
* @example belongsCell: 'rowCell'
*/
belongsCell: Omit<
belongsCell: Exclude<
`${CellType}`,
'dataCell' | 'mergedCell' | 'seriesNumberCell'
>;
Expand Down
1 change: 0 additions & 1 deletion packages/s2-react/playground/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ export const s2Options: SheetComponentOptions = {
seriesNumber: {
enable: false,
},

transformCanvasConfig() {
return {
supportsCSSTransform: true,
Expand Down

0 comments on commit 8ec830e

Please sign in to comment.