Skip to content
New issue

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

refactor(table): component optimization #5146

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

zhangpaopao0609
Copy link
Collaborator

🤔 这个 PR 的性质是?

  • 重构

🔗 相关 Issue

#5047

📝 更新日志

  • refactor(table): component optimization

  • 本条 PR 不需要纳入 Changelog

@zhangpaopao0609
Copy link
Collaborator Author

需要特别检查一下 packages/components/table/base-table.tsx 的 expose,以前暴露的是

    return {
      thList,
      classPrefix,
      innerPagination,
      globalConfig,
      tableFootHeight,
      virtualScrollHeaderPos,
      tableSize,
      tableWidth,
      tableElmWidth,
      tableRef,
      tableElmRef,
      sizeClassNames,
      tableBaseClass,
      spansAndLeafNodes,
      dynamicBaseTableClasses,
      tableContentStyles,
      tableElementStyles,
      dividerBottom,
      virtualScrollClasses,
      tableLayoutClasses,
      tableElmClasses,
      tableContentRef,
      isFixedHeader,
      isWidthOverflow,
      isFixedColumn,
      rowAndColFixedPosition,
      showColumnShadow,
      thWidthList,
      isPaginateData,
      dataSource,
      affixHeaderRef,
      affixFooterRef,
      bottomContentRef,
      paginationRef,
      showAffixHeader,
      showAffixFooter,
      scrollbarWidth,
      isMultipleHeader,
      showRightDivider,
      resizeLineRef,
      resizeLineStyle,
      columnResizeParams,
      horizontalScrollbarRef,
      tableBodyRef,
      virtualConfig,
      showAffixPagination,
      tActiveRow,
      hoverRow,
      showElement,
      scrollToElement,
      renderPagination,
      renderTNode,
      onFixedChange,
      onHorizontalScroll,
      updateAffixHeaderOrFooter,
      onInnerVirtualScroll,
      refreshTable,
      scrollColumnIntoView,
      onTableFocus,
      onTableBlur,
      onInnerRowClick,
      paginationAffixRef,
      horizontalScrollAffixRef,
      headerTopAffixRef,
      footerBottomAffixRef,
      tableRefTabIndex,
    };

现在,对照着文档,应当只需要暴露这三个即可

    context.expose({
      refreshTable,
      scrollColumnIntoView,
      scrollToElement,
    });

Copy link

pkg-pr-new bot commented Mar 3, 2025

Open in Stackblitz

npm i https://pkg.pr.new/tdesign-vue-next@5146

commit: f4c43f0

Copy link
Contributor

github-actions bot commented Mar 3, 2025

完成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant