index.js 546 B

1234567891011121314151617181920212223
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. relation: {
  4. name: 'row',
  5. type: 'ancestor'
  6. },
  7. props: {
  8. span: Number,
  9. offset: Number
  10. },
  11. data: {
  12. style: ''
  13. },
  14. methods: {
  15. setGutter(gutter) {
  16. const padding = `${gutter / 2}px`;
  17. const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : '';
  18. if (style !== this.data.style) {
  19. this.setData({ style });
  20. }
  21. }
  22. }
  23. });