import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  properties: {
    square: {
      type: Boolean,
      value: false,
      observer(value) {
        if (value) {
          const customClass = this.data.customClass + ' ht-tag-square'
          this.setData({
            customClass
          })
        }
      }
    },
    type: {
      type: String,
      value: 'default'
    },
    size: {
      type: String
    },
    color: {
      type: String
    },
    plain: {
      type: Boolean,
      value: false
    },
    round: {
      type: Boolean,
      value: false
    },
    mark: {
      type: Boolean,
      value: false
    },
    textColor: {
      type: String
    },
    closeable: {
      type: String
    },
    customClass: {
      type: String
    }

  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClose({detail}) {
      this.triggerEvent('close', detail)
    },
  }
})
