jiaqingjiayi-xiaochengxu/甲情_甲意/node_modules/antd-mini/es/TabBar/index.js
2024-11-15 11:51:28 +08:00

21 lines
575 B
JavaScript

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',
}),
]);