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>

 

 父组件:

  

 

 

 

posted @ 2021-04-14 17:52  潜跃  阅读(323)  评论(0编辑  收藏  举报