index.js 600 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var component_1 = require('../common/component');
  4. var PRESETS = ['error', 'search', 'default', 'network'];
  5. component_1.VantComponent({
  6. props: {
  7. description: String,
  8. image: {
  9. type: String,
  10. value: 'default',
  11. },
  12. },
  13. created: function () {
  14. if (PRESETS.indexOf(this.data.image) !== -1) {
  15. this.setData({
  16. imageUrl:
  17. 'https://img.yzcdn.cn/vant/empty-image-' + this.data.image + '.png',
  18. });
  19. } else {
  20. this.setData({ imageUrl: this.data.image });
  21. }
  22. },
  23. });