小程序rich-text單行省略
返回數(shù)據(jù)為HTML字符串,需要在rich-text渲染, 需要在一行顯示,超出部分進行隱藏
template片段
<rich-text :nodes="formatRich(item.examName || '')"></rich-text>
script方法
formatRich(val) {
return "<div style='overflow: hidden;text-overflow: ellipsis;white-space: nowrap;'>" + val + "</div>"
},
通過以上方法即可解決文章來源:http://www.zghlxwxcb.cn/news/detail-574254.html
參考文檔:https://blog.csdn.net/u013611033/article/details/121535633文章來源地址http://www.zghlxwxcb.cn/news/detail-574254.html
到了這里,關(guān)于小程序rich-text單行省略的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!