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
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 });
    }
  },
});