element row源码

row.js

export default {
  name: 'ElRow',

  componentName: 'ElRow',

  props: {
    // 标签
    tag: {
      type: String,
      default: 'div'
    },
    // 栅格间隔    number    —    0
    gutter: Number,
    // 布局模式,可选 flex,现代浏览器下有效
    type: String,
    // flex 布局下的水平排列方式    string    start/end/center/space-around/space-between
    justify: {
      type: String,
      default: 'start'
    },
    // flex 布局下的垂直排列方式    string    top/middle/bottom    top
    align: {
      type: String,
      default: 'top'
    }
  },

  computed: {
    // 样式
    style () {
      const ret = {};

      if (this.gutter) {
        ret.marginLeft = `-${this.gutter / 2}px`;
        ret.marginRight = ret.marginLeft;
      }

      return ret;
    }
  },

  render (h) {
    return h(this.tag, {
      class: [
        'el-row',
        this.justify !== 'start' ? `is-justify-${this.justify}` : '',
        this.align !== 'top' ? `is-align-${this.align}` : '',
        { 'el-row--flex': this.type === 'flex' }
      ],
      style: this.style
    }, this.$slots.default);
  }
};

 

转载于:https://www.cnblogs.com/wsk1576025821/p/10979373.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值