亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue 如何實現切割字符串,并隔行顯示

vue 如何實現切割字符串,并隔行顯示

侃侃無極 2018-07-05 13:17:22
若字符串長度<6,正常渲染,若字符串超出6個字,則進行分割,存入數組,點擊展示剩余字符串內容,圖中是jq實現,vue新手,請教下vue用v-for指令如何實現?THML部分代碼:      <tr class="hap_table_tr">        <td class="hap_table_bank"><p>工行</p></td>        <td><p>不準入</p></td>        <td><time>2018-05-23</time></td>        <td class="hap_table_notes"><p class="hap_table_note">備注備注</p><i class="hap_table_drop1"></i></td>      </tr>      <tr class="hap_table_tr">        <td class="hap_table_bank"><p>建行</p></td>        <td><p>談費率</p></td>        <td><time>2018-05-23</time></td>        <td class="hap_table_notes"><p class="hap_table_note">備注備注備注安大師傅</p><i class="hap_table_drop1"></i></td>      </tr>      <tr class="hap_table_tr">        <td class="hap_table_bank"><p>農行</p></td>        <td><p>協議流轉</p></td>        <td><time>2018-05-23</time></td>        <td class="hap_table_notes"><p class="hap_table_note">即將拉開交流解決骷髏精靈</p><i class="hap_table_drop1"></i></td>      </tr>
查看完整描述

2 回答

?
慕萊塢森

TA貢獻1810條經驗 獲得超4個贊

一個思路,首先,給hap_table_note類名加個限高,六字寬度。然后判斷數據長度,大于6,顯示后邊圖標,否則不顯示。當點擊后,去掉限高即可顯示完整

查看完整回答
反對 回復 2018-07-12
?
躍然一笑

TA貢獻1826條經驗 獲得超6個贊

新建一個組件傳入字符串,組件內部維護一個bool變量。默認顯示6個字以下。點擊將這個變量置為true,組件顯示完整字符串

查看完整回答
反對 回復 2018-07-12
  • 2 回答
  • 0 關注
  • 4578 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號