vue—封装无数据时默认展示组件

效果图:

  

 子组件: 

<template>
    <view class="nothing animated fadeIn">
        <image src="../../static/common/nothing.png" mode="widthFix"></image>
    </view>
</template>

<script>
</script>

<style scoped>
    .nothing{
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #FFFFFF;
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
    }
    .nothing image{
        width: 50%;
    }
</style>

 父组件:

  

 

一个小小后端的爬行痕迹
原文地址:https://www.cnblogs.com/heikedeblack/p/14659179.html