row.js 830 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. export default {
  2. name: 'ElRow',
  3. componentName: 'ElRow',
  4. props: {
  5. tag: {
  6. type: String,
  7. default: 'div'
  8. },
  9. gutter: Number,
  10. type: String,
  11. justify: {
  12. type: String,
  13. default: 'start'
  14. },
  15. align: {
  16. type: String,
  17. default: 'top'
  18. }
  19. },
  20. computed: {
  21. style() {
  22. const ret = {};
  23. if (this.gutter) {
  24. ret.marginLeft = `-${this.gutter / 2}px`;
  25. ret.marginRight = ret.marginLeft;
  26. }
  27. return ret;
  28. }
  29. },
  30. render(h) {
  31. return h(this.tag, {
  32. class: [
  33. 'el-row',
  34. this.justify !== 'start' ? `is-justify-${this.justify}` : '',
  35. this.align !== 'top' ? `is-align-${this.align}` : '',
  36. { 'el-row--flex': this.type === 'flex' }
  37. ],
  38. style: this.style
  39. }, this.$slots.default);
  40. }
  41. };