UNPKG

antd-mini

Version:

antd-mini 是支付宝小程序 UI 组件库,遵循 Ant Design 规范。

21 lines (20 loc) 575 B
import { TabBarDefaultProps } from './props'; import { Component, triggerEvent } from '../_util/simply'; import mixinValue from '../mixins/value'; Component(TabBarDefaultProps, { onChange: function (e) { var index = e.currentTarget.dataset.index; if (index === this.getValue()) { return; } if (!this.isControlled()) { this.update(index); } triggerEvent(this, 'change', index, e); }, }, null, [ mixinValue({ valueKey: 'current', defaultValueKey: 'defaultCurrent', }), ]);