vue2 ant-design table空数据提示

系统有个默认的提示,但是有时候会根据项目要求实现不同的提示

话说这个ant框架的文档啊,能多写几个字吗,真的看不懂咋用啊

 <a-table  columns="columns" :loading="loading" :data-source="dataList"  :locale="locale">  
</a-table>
在data里面定义一下locale 就可以了,可以直接写html啥的,还挺方便的,这样及有标题,也有空数据提示了
data() {
        return { 
          dataList:[],
          loading: false,
          locale:{
            emptyText: () => (
              <div class="custom-empty" >
                <img src={require("@/assets/images/empty.png")} alt="暂无数据" style="width: 180px; height: 180px" />
                <p style="color:rgba(153, 153, 153, 1);font-size:12px;">暂无数据,请点击“ <span style="color:rgba(197, 24, 31, 1);">+新增模板</span>”添加ESG模板</p>
              </div>
            )
          }
      };
    }

 



posted @ 2025-02-17 16:56  西贝小小凤  阅读(166)  评论(0)    收藏  举报