index.js 613 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. var _component = require("../common/component");
  3. (0, _component.VantComponent)({
  4. relation: {
  5. name: "row",
  6. type: "ancestor",
  7. current: "col"
  8. },
  9. props: {
  10. span: Number,
  11. offset: Number
  12. },
  13. data: {
  14. viewStyle: ""
  15. },
  16. methods: {
  17. setGutter: function setGutter(gutter) {
  18. var padding = "".concat(gutter / 2, "px");
  19. var viewStyle = gutter ? "padding-left: ".concat(padding, "; padding-right: ").concat(padding, ";") : "";
  20. if (viewStyle !== this.data.viewStyle) {
  21. this.setData({
  22. viewStyle: viewStyle
  23. });
  24. }
  25. }
  26. }
  27. });