index.js 1.3 KB

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