Avue-crud 表格组件列文字过长省略并展示指定行数

如果单纯只是为了省略内容,可以设置 option.column.xxx.overHidden 为 true。

给列添加 slot 为 true,然后自定义列的时候用 TextEllipsis 组件即可:

<avue-crud ref="crud"
           ……>
  <!-- 看这 -->
  <template slot="introduction" slot-scope="scope">
    <avue-text-ellipsis :text="scope.row.introduction" :height="100">
      <small slot="more">...</small>
    </avue-text-ellipsis>
  </template>
</avue-crud>

<script>
……
option:{
      
      
  column:[
	 ……,
     {
      
      
      label: '简介',
      prop: 'introduction',
      // 看这
      slot: true
    },
    ……
  ]
},
……
</script>

参考

猜你喜欢

转载自blog.csdn.net/duanluan/article/details/119988205