import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  properties: {

    name: {
      type: String,
      value: 'fade'
    },
    show: {
      type: Boolean,
      value: true
    },
    duration: {
      type: [Number, Object],
      value: 300
    },
    customStyle: {
      type: String
    },
    customClass: {
      type: String
    },
    enterClass: {
      type: String
    },
    enterActiveClass: {
      type: String
    },
    enterToClass: {
      type: String
    },
    leaveClass: {
      type: String
    },
    leaveActiveClass: {
      type: String
    },
    leaveToClass: {
      type: String
    }

  },

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

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleBeforeEnter({detail}) {
      this.triggerEvent('before-enter', detail)
    },
    handleEnter({detail}) {
      this.triggerEvent('enter', detail)
    },
    handleAfterEnter({detail}) {
      this.triggerEvent('after-enter', detail)
    },
    handleBeforeLeave({detail}) {
      this.triggerEvent('before-leave', detail)
    },
    handleLeave({detail}) {
      this.triggerEvent('leave', detail)
    },
    handleAfterLeave({detail}) {
      this.triggerEvent('after-leave', detail)
    },
  }
})
