【问题标题】:With vue-material, how can I have text wrap instead of overflow to ellipsis in a list?使用 vue-material,如何在列表中进行文本换行而不是溢出到省略号?
【发布时间】:2020-01-29 01:11:08
【问题描述】:

我有:

        <md-list-item>
          <md-icon v-bind:style="{color: transcript.color}">account_circle</md-icon>

          <div class="md-list-item-text">
            <p>{{ transcript.text }}</p>
          </div>

          <md-button class="md-icon-button md-list-action">
            <small>some stuff</small>
          </md-button>
        </md-list-item>

问题是transcript.text 可以比一行长,所以有一个text-overflow: ellipsis 集合。我尝试将text-overflow: visible !important 添加为范围样式,但这似乎被忽略了。

那么我怎样才能让我的文本正常中断并扩展到多行呢?

【问题讨论】:

标签: css vue.js material-design vue-material


【解决方案1】:
.md-list-item-text p {
  white-space: normal;
  padding-bottom: 1rem;
}

做到了!

【讨论】:

    猜你喜欢
    • 2015-10-20
    • 1970-01-01
    • 2013-04-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 2020-12-10
    • 2020-06-24
    • 2018-07-22
    相关资源
    最近更新 更多