12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <template>
- <view class="no-data-view" :style="{'margin-top':conf.top+'vh',}">
- <image v-if="conf.imgUrl" :style="{width:conf.imgWidth,height:config.imgHeight}" :src="conf.imgUrl?conf.imgUrl:'/static/common/nodata.png'"></image>
- <image v-if="!conf.imgUrl" class="no-data" src="/static/common/nodata.png"></image>
- <view :style="{color:conf.color,'font-size':conf.fSize,'padding-top':conf.txtTop+'rpx'}">{{conf.content}}</view>
- </view>
- </template>
- <script>
- export default {
- name: 'nodata',
- props:{
- config:{
- type:Object,
- default:function(){
- return{
- }
- }
- },
- },
- data() {
- return {
- conf:{
- type:'1',
- top:22,
- imgWidth:0,
- imgHeight:0,
- imgUrl:'',
- content:'暂无数据~',
- fSize:30,
- color:'#B3B3B3',
- txtTop:20,
- url: this.$mConfig.staticUrl,
- }
- }
- },
- created() {
- this.init();
- },
- methods: {
- init(){
- this.conf = Object.assign(this.conf, this.config);
- }
- }
- }
- </script>
- <style scoped>
- .no-data-view{
- text-align: center;
- }
- .no-data{
- width: 475rpx;
- height: 335rpx;
- }
-
- </style>
|