wechat_yxcl/components/warning.vue
2020-11-12 14:57:34 +08:00

56 lines
955 B
Vue

<template>
<view class="warning-image-box">
<block v-if="!isConnect">
<image class="no-wifi" src="../static/images/no-wifi.png" mode="aspectFit"></image>
<text>网络未连接</text>
</block>
<block v-else-if="!isLoading && !noData">
<image class="no-data" src="../static/images/no-data.png" mode="aspectFit"></image>
<text>{{text || '数据空空'}}</text>
</block>
</view>
</template>
<script>
import { mapGetters} from 'vuex'
export default {
props: ['noData','text'],
data() {
return {
}
},
computed:{
...mapGetters({
isConnect: 'getConnect',
isLoading: 'getLoading'
})
},
methods: {
}
}
</script>
<style scoped>
.warning-image-box{
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
flex: 1;
padding-top: 20%;
}
.no-wifi {
width: 374upx;
height: 348upx;
}
.no-data {
width: 374upx;
height: 288upx;
}
</style>