index.js 553 B

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