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

Bug: PrimeVue 的 TreeTable 无法实现右对齐 #56

Open
zjp-CN opened this issue Aug 29, 2024 · 1 comment
Open

Bug: PrimeVue 的 TreeTable 无法实现右对齐 #56

zjp-CN opened this issue Aug 29, 2024 · 1 comment
Labels
非本仓库 bug 来自框架、依赖等不属于本仓库能解决的 bug

Comments

@zjp-CN
Copy link
Member

zjp-CN commented Aug 29, 2024

primefaces/primevue#1016

primefaces/primevue#1689

<Column style="text-align: right"> not work
<Column bodyStyle="text-align: right"> not work

甚至于我在浏览器中花费几小时调试这个的时候,直接修改这些元素的 css 值,也无法做到列右对齐。

@zjp-CN zjp-CN added the 非本仓库 bug 来自框架、依赖等不属于本仓库能解决的 bug label Aug 29, 2024
@zjp-CN
Copy link
Member Author

zjp-CN commented Nov 9, 2024

我找到了方法:

应该使用 headerStyle (对于表头)和 style(对于表头和单元格);也可以结合 pt:

primefaces/primevue#3590 (comment)

截图_20241109140126

验证有效:

<Column ... style="text-align: center;" headerStyle="display:flex; justify-content: center;" />

注意:虽然文档说 style 适用于 header,但如何将上面的 headerStyle 写到 style 内,那列单元格是错乱的(不确定是不是固定表头导致的)。

注意:headerClass 这个我试了无效。

更新:最后我写的是

<Column :pt="ptColumn" />
const ptColumn = ref({
  columnHeaderContent: { style: { "justify-content": "center" } },
  bodyCell: { style: { "text-align": "center" } }
});

我测试了,可以单独调整表头和单元格的对齐~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
非本仓库 bug 来自框架、依赖等不属于本仓库能解决的 bug
Projects
None yet
Development

No branches or pull requests

1 participant