- .uni-table {
- table-layout: fixed;
- // height: 15.5rem;
- overflow: hidden;
- text-overflow: ellipsis; //省略号表示
- white-space: nowrap; //不换行
-
- .uni-table-td {
- table-layout: inherit;
- overflow: hidden;
- text-overflow: ellipsis; //省略号表示
- white-space: nowrap; //不换行
- }
-
- .uni-table-th {
- width: 360rpx; // !important
- box-sizing: content-box;
- }
- }
在第一列uni-th中加上类名first,随后设置固定位置,个人尝试过使用position: sticky;在App中并没有生效。此外,element-plus导入到uni-app项目运行到真机中也会报错,因为样式冲突和导入方式等问题,无法使用,后续找到解决方案会更新,所以没有使用el-table来实现。
- .first {
- width: 120rpx;
- position: fixed;
- background-color: #FFFAF2;
- z-index: 10;
- }
- <uni-popup ref="popup" :mask-click="false">
- <uni-table ref="table" border stripe>
- <uni-tr>
- <uni-th width="90" align="center">123uni-th>
- <uni-th width="200" align="center">123uni-th>
-
- uni-tr>
- <uni-tr>
- <uni-th width="90" align="center">234uni-th>
- <uni-th width="200" align="center">234uni-th>
-
- uni-tr>
- <uni-tr>
- <uni-th width="90" align="center">345uni-th>
- <uni-th width="200" align="center">345uni-th>
- uni-tr>
-
- uni-table>
- <button @click="close">关闭button>
- uni-popup>
通过检查页面效果来找到对应隐藏的内容,在进行样式设置,如果没有生效,考虑使用!important。
- .is-phone-hide {
- display: block;
- }
-
- .uni-pagination {
- font-size: 24rpx;
-
- .uni-pagination__num-tag {
- margin: 0 20rpx;
- }
-
- .uni-pagination__num {
- display: inline-block;
- }
- }


- .uni-container {
- margin-top: 60rpx;
-
- .example-demonstration {
- height: 590rpx;
- }
-
- .uni-table {
- table-layout: fixed;
- // height: 15.5rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-
- .uni-table-td {
- table-layout: inherit;
- overflow: hidden;
- text-overflow: ellipsis; //省略号表示
- white-space: nowrap; //不换行
- }
-
- .uni-table-th {
- width: 360rpx; // !important
- box-sizing: content-box;
- }
-
- .taxId {
- padding-left: 60rpx;
- width: 240rpx;
- }
-
- uni-view {
- overflow: hidden;
- width: 100%;
- text-overflow: ellipsis; //省略号表示
- white-space: nowrap; //不换行
- }
-
-
- .first {
- width: 120rpx;
- // display: flex;
- position: fixed;
- background-color: #FFFAF2;
- z-index: 10;
- }
-
- .fixed-th {
- width: 77rpx;
- }
-
-
- }
-
- .is-phone-hide {
- display: block;
- }
-
- .uni-pagination {
- font-size: 24rpx;
-
- .uni-pagination__num-tag {
- margin: 0 20rpx;
- }
-
- .uni-pagination__num {
- display: inline-block;
- }
- }
-
- }