如何写一个简单的table中暂无数据组件

当你去做后端请求时,并且接口的data数组中为null或者数据为空时挡住用户眼睛的“遮罩层”

<template>
<span class="no_wrap">
<span class="no_data">
      <!-- <img src="../../assets/images/boms/fonts/no data.svg" /> -->
<img src="./img/nodata_table_zh.png"/>
<p class="no_data_text">暂无数据</p>
</span>
</span>
</template>

<script>
export default {};
</script>

<style scoped lang="scss">
/*暂无数据*/
.no_wrap {
  height: 100%;
  display: flex;
}
.no_data {
  margin: 20px auto;
  text-align: center;
}
.no_data img {
  /* width: 145px;
  height: 145px; */
}
.no_data p {
  font-size: 12px;
  color: #999;
  margin: 0;
}
</style>

猜你喜欢

转载自www.cnblogs.com/robot666/p/12080911.html