index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var component_1 = require('../common/component');
  4. var relation_1 = require('../common/relation');
  5. component_1.VantComponent({
  6. relation: relation_1.useChildren('grid-item'),
  7. props: {
  8. square: {
  9. type: Boolean,
  10. observer: 'updateChildren',
  11. },
  12. gutter: {
  13. type: null,
  14. value: 0,
  15. observer: 'updateChildren',
  16. },
  17. clickable: {
  18. type: Boolean,
  19. observer: 'updateChildren',
  20. },
  21. columnNum: {
  22. type: Number,
  23. value: 4,
  24. observer: 'updateChildren',
  25. },
  26. center: {
  27. type: Boolean,
  28. value: true,
  29. observer: 'updateChildren',
  30. },
  31. border: {
  32. type: Boolean,
  33. value: true,
  34. observer: 'updateChildren',
  35. },
  36. direction: {
  37. type: String,
  38. observer: 'updateChildren',
  39. },
  40. iconSize: {
  41. type: String,
  42. observer: 'updateChildren',
  43. },
  44. reverse: {
  45. type: Boolean,
  46. value: false,
  47. observer: 'updateChildren',
  48. },
  49. },
  50. methods: {
  51. updateChildren: function () {
  52. this.children.forEach(function (child) {
  53. child.updateStyle();
  54. });
  55. },
  56. },
  57. });