index.js 560 B

1234567891011121314151617181920212223
  1. import { VantComponent } from '../common/component';
  2. import { useChildren } from '../common/relation';
  3. VantComponent({
  4. relation: useChildren('col', function (target) {
  5. const { gutter } = this.data;
  6. if (gutter) {
  7. target.setData({ gutter });
  8. }
  9. }),
  10. props: {
  11. gutter: {
  12. type: Number,
  13. observer: 'setGutter',
  14. },
  15. },
  16. methods: {
  17. setGutter() {
  18. this.children.forEach((col) => {
  19. col.setData(this.data);
  20. });
  21. },
  22. },
  23. });