亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue for循環(huán)出來的數(shù)據(jù)實現(xiàn)用逗號隔開

 更新時間:2024年10月16日 09:08:45   作者:性野喜悲  
HTML(HyperText Markup Language)是用于創(chuàng)建網(wǎng)頁的標準標記語言,正確的HTML編碼和結構對于網(wǎng)頁的正確顯示至關重要,當HTML代碼正確無誤時,網(wǎng)頁的效果圖將與設計師的預期相符,反之則可能出現(xiàn)布局錯亂、樣式失效等問題

vue for循環(huán)出來的數(shù)據(jù)用逗號隔開

  • HTML:
//tableData為后臺返回的數(shù)據(jù),roleList為表格對象中的子數(shù)組 
<el-table :data="tableData" style="width: 100%">
      <el-table-column
                  label="所屬角色"
                  min-width="160"
                  show-overflow-tooltip
                >
                  <template slot-scope="scope">
                    <span
                      v-for="(item, index) in scope.row.roleList"
                      :key="index"
                      >{{item.roleName}}</span
                    >
                  </template>
                </el-table-column>
</el-table>

效果圖(實際是兩個角色)

  • 正確的HTML:
//tableData為后臺返回的數(shù)據(jù),roleList為表格對象中的子數(shù)組 
<el-table :data="tableData" style="width: 100%">
      <el-table-column
                  label="所屬角色"
                  min-width="160"
                  show-overflow-tooltip
                >
                  <template slot-scope="scope">
                    <span
                      v-for="(item, index) in scope.row.roleList"
                      :key="index"
                      >{{scope.row.roleList.length-1!==index?item.roleName+',':item.roleName}}</span
                    >
                  </template>
                </el-table-column>
</el-table>

正確的效果圖(使用逗號隔開了的效果)

總結

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

最新評論