侧边栏壁纸
  • 累计撰写 75 篇文章
  • 累计创建 41 个标签
  • 累计收到 3 条评论

目 录CONTENT

文章目录

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

已删除用户
2021-08-30 / 0 评论 / 0 点赞 / 41 阅读 / 1272 字 / 正在检测是否收录...

如果单纯只是为了省略内容,可以设置 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>

参考

0

评论区