Skip to content

Commit

Permalink
fix(table): optional affix ref (#1550)
Browse files Browse the repository at this point in the history
* fix(table): optional affix ref

* fix(collapse): unit test update
  • Loading branch information
uyarn committed Sep 22, 2022
1 parent fc38635 commit e8cc1ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/collapse/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ describe('CollapsePanel', () => {

const panel = wrapper.findComponent({ ref: '1' });
expect(panel.find('.t-collapse-panel__content > div').html()).toBe('<div>内容</div>');
expect(panel.find('.t-collapse-panel__header > h4').html()).toBe('<h4>标题</h4>');
expect(panel.find('.t-collapse-panel__header > span').html()).toBe('<span>操作</span>');
expect(panel.find('.t-collapse-panel__header-content > h4').html()).toBe('<h4>标题</h4>');
expect(panel.find('.t-collapse-panel__header-right > span').html()).toBe('<span>操作</span>');
});

test('content', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/table/hooks/useFixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ export default function useFixed(

const updateAffixPosition = () => {
// 在表格高度变化的时候 需要手动调整affix的位置 因为affix本身无法监听到这些变化触发重新计算
paginationAffixRef.value.handleScroll();
horizontalScrollAffixRef.value.handleScroll();
paginationAffixRef.value?.handleScroll?.();
horizontalScrollAffixRef.value?.handleScroll?.();
};

const updateThWidthList = (trList: HTMLCollection | { [colKey: string]: number }) => {
Expand Down

0 comments on commit e8cc1ff

Please sign in to comment.