Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

表格组件列宽问题 #165

Closed
jenifly opened this issue Jan 7, 2021 · 1 comment
Closed

表格组件列宽问题 #165

jenifly opened this issue Jan 7, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jenifly
Copy link

jenifly commented Jan 7, 2021

创建列:

<BasicTable @register="registerTable">

function getTestColumns(): BasicColumn[] {
  let columns = []
  for (let i = 0; i < 20; i++) {
    columns.push({
      title: 't' + i,
      width: 40,
      dataIndex: 'test' + i,
      defaultHidden: i % 2 === 0,
    })
  }
  return columns
}
const [registerTable] = useTable({
  api: pandectApi,
  columns: getTestColumns(),
  bordered: true,
 })

首次显示,有横向进度条
微信截图_20210106192751
勾选t0后,列宽重新计算
微信截图_20210106193149
将t3,t5左fixed,这种情况下无论如何操作都出现空列
微信截图_20210106193752
留一列不设置宽度

function getTestColumns(): BasicColumn[] {
  let columns = []
  columns.push({
    title: 't',
    dataIndex: 'test',
  })
  for (let i = 0; i < 20; i++) {
    columns.push({
      title: 't' + i,
      width: Math.max(40, i * 10),
      dataIndex: 'test' + i,
      defaultHidden: i % 2 === 0,
    })
  }
  return columns
}

首次显示,t列宽度占满表格
微信截图_20210106194530
勾选t0后列表显示正常,fixed功能也正常
微信截图_20210106195115
在设置fixed后希望重新点击显示/隐藏列还能保留设置的fixed状态
大佬辛苦~

@anncwb anncwb added the bug Something isn't working label Jan 9, 2021
anncwb added a commit that referenced this issue Jan 11, 2021
@anncwb
Copy link
Collaborator

anncwb commented Jan 11, 2021

出现空列留一列不计算即可。 那一列很长是因为你的电脑屏幕可能太宽,把其他的列从40设置到100+应该就可以了。其他问题已修复

@anncwb anncwb closed this as completed Jan 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants