jhzh
2025-04-03 db12897dc68c68d40c557aa59ad78022e2b30ac2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
<uni-shadow-root class="vant-empty-index"><view class=" custom-class van-empty">
  <view class="van-empty__image">
    <image v-if="imageUrl" class="van-empty__image__img" :src="imageUrl"></image>
  </view>
  <p class="van-empty__description">
    {{ description }}
  </p>
  <view class="van-empty__bottom">
    <slot></slot>
  </view>
</view></uni-shadow-root>
</template>
<wxs src="../wxs/utils.wxs" module="utils"></wxs>
<script>
 
global['__wxVueOptions'] = {components:{}}
 
global['__wxRoute'] = 'vant/empty/index'
import { VantComponent } from '../common/component';
const PRESETS = ['error', 'search', 'default', 'network'];
VantComponent({
  props: {
    description: String,
    image: {
      type: String,
      value: 'default',
    },
  },
  created() {
    if (PRESETS.indexOf(this.data.image) !== -1) {
      this.setData({
        imageUrl: `https://img.yzcdn.cn/vant/empty-image-${this.data.image}.png`,
      });
    } else {
      this.setData({ imageUrl: this.data.image });
    }
  },
});
export default global['__wxComponents']['vant/empty/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
</style>