weex 开发APP 多行文本溢出处理

weex中文字溢出不能使用常规的overflow:hidden

如:

  .text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

这个也试了不生效

  .text {
      display: -webkit-box;
      text-overflow: ellipsis;
      overflow : hidden;
      -webkit-line-clamp: 2; 
      -webkit-box-orient: vertical;

  }

最后使用 weex内置的lines完美解决

  .text {
        lines: 3;
        font-size: 28px;
        line-height: 40px;
        color: #666666;
        text-overflow: ellipsis;
  }

特此记录

原文地址:https://www.cnblogs.com/dengxiaoning/p/11681270.html