欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

vue NoData

程序员文章站 2022-06-19 08:01:20
...

NoData组件

<template>
  <div class="panel-noData" v-if="shown">
    <i class="iconfont icon-zanmeishuju" :style="istyle"></i>
    <span>暂无数据</span>
  </div>
</template>

<script>
export default {
  name: "nodata",
  data() {
    return {
      shown: true
    };
  },
  props: {
    iconSize: {
      type: [Number, String],
      default: 40
    }
  },
  watch: {},
  computed: {
    istyle() {
      return {
        "font-size": this.iconSize + "px"
      };
    }
  },
  mounted() {},
  methods: {}
};
</script>

<style lang="scss">
.panel-noData {
  height: 100%;
  min-height: 200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  i.iconfont {
    margin-bottom: 10px;
  }
  span {
    font-size: 18px;
    color: #99a4b8;
  }
}
</style>

相关标签: vue组件 vue