import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  source: true,
  externalClasses: ['custom-class'],
  relations: {
    '../ht-row/index': {
      type: 'ancestor'
    }
  },
  properties: {
    span: Number,
    offset: Number
  },

  data: {
    style: ''
  },

  methods: {
    setGutter(gutter) {
      const padding = `${gutter / 2}px`
      const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : ''

      if (style !== this.data.style) {
        this.setData({style})
      }
    }
  }
})
