组件演示(多行超出省略号用法)

text.png

axml

  1. <view class="wrapper">
  2. <x-nav-bar showArrow="{{true}}" title="Div"></x-nav-bar>
  3. <text class="text1">这是一段很长很长很长很长很长的文字</text>
  4. </view>

css

  1. .wrapper {
  2. max-width: 100%;
  3. height: 100%;
  4. display: flex;
  5. flex-direction: column;
  6. justify-content: flex-start;
  7. align-items: center;
  8. background-color: #eeeeee;
  9. }
  10. .text1{
  11. width: 200rpx;
  12. text-overflow: ellipsis;
  13. max-lines: 1;
  14. }