css - 如何将 Material UI TableSortLabel 箭头更改为左侧?
问题描述
我的表中有需要排序的右对齐和左对齐列。在列右对齐的情况下,我希望图标位于标题的左侧。否则会有一个尴尬的空间右对齐,因为图标只是隐藏,而不是不显示。
TabelSortLabel API 中没有任何东西允许这样做。
解决方案
您可以使用 flex-direction: row-reverse,基于 alignContent 属性
flexDirection: ({ header }: Props) => {
return header?.alignContent && header?.alignContent === 'right' ? 'row-reverse' : 'row';
},
推荐阅读
- spring - 如何修复“类型不匹配。必需:java.lang.String 找到:kotlin.String”
- c# - 我可以使用c#以与硬件无关的方式打开串口500k波特率吗?
- javascript - 从具有解构赋值的对象中提取字段而不创建变量
- angular - Angular 嵌套两个 ngFor 和异步管道;一切都在不断尝试重新加载
- http - 如何将有状态客户端传递给 lambda 函数?
- docker - 如何对多个容器运行单个 docker exec 命令
- anylogic - 在旧版本中打开 Anylogic 模型
- reactjs - 如何在组件覆盖的帮助下在材料表中添加列?
- database - 我需要分类单词的词汇数据库
- laravel - 使用 Socialite 对 laravel 5.4 进行身份验证时,Google Auth 登录个人资料的名字和姓氏为空