index.js 628 B

1234567891011121314151617181920212223242526
  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('col', function (target) {
  7. var gutter = this.data.gutter;
  8. if (gutter) {
  9. target.setData({ gutter: gutter });
  10. }
  11. }),
  12. props: {
  13. gutter: {
  14. type: Number,
  15. observer: 'setGutter',
  16. },
  17. },
  18. methods: {
  19. setGutter: function () {
  20. var _this = this;
  21. this.children.forEach(function (col) {
  22. col.setData(_this.data);
  23. });
  24. },
  25. },
  26. });