var _my$getSystemInfoSync = my.getSystemInfoSync(),
    windowWidth = _my$getSystemInfoSync.windowWidth;

Component({
  props: {
    className: '',
    tabBarUnderlineColor: '#108ee9', // 选中选项卡下划线颜色
    tabBarActiveTextColor: '#108ee9', // 选中选项卡字体颜色
    tabBarInactiveTextColor: '#333333', // 未选中选项卡字体颜色
    tabBarBackgroundColor: '#ffffff', // 选项卡背景颜色
    showPlus: false,
    swipeable: true,
    activeTab: 0 // 当前激活tab
  },
  data: {
    windowWidth: windowWidth,
    tabWidth: 0.25,
    autoplay: false,
    animation: false,
    version: my.SDKVersion
  },
  didMount: function didMount() {
    var tabs = this.props.tabs;

    this.setData({
      tabWidth: tabs.length > 3 ? 0.25 : 1 / tabs.length,
      animation: true,
      autoplay: true
    });
  },

  methods: {
    handleSwiperChange: function handleSwiperChange(e) {
      var current = e.detail.current;


      if (this.props.onChange) {
        this.props.onChange({ index: current });
      }
    },
    handleTabClick: function handleTabClick(e) {
      var index = e.target.dataset.index;


      if (this.props.onTabClick) {
        this.props.onTabClick({ index: index });
      }
    },
    handlePlusClick: function handlePlusClick() {
      if (this.props.onPlusClick) {
        this.props.onPlusClick();
      }
    }
  }
});