iview/src/components/date-picker/panel/mixin.js

28 lines
801 B
JavaScript
Raw Normal View History

2016-12-19 14:44:07 +08:00
const prefixCls = 'ivu-picker-panel';
const datePrefixCls = 'ivu-date-picker';
export default {
methods: {
iconBtnCls (direction, type = '') {
return [
`${prefixCls}-icon-btn`,
`${datePrefixCls}-${direction}-btn`,
`${datePrefixCls}-${direction}-btn-arrow${type}`,
2016-12-25 22:49:42 +08:00
];
2016-12-19 14:44:07 +08:00
},
handleShortcutClick (shortcut) {
if (shortcut.value) this.$emit('on-pick', shortcut.value());
if (shortcut.onClick) shortcut.onClick(this);
},
handlePickClear () {
this.$emit('on-pick-clear');
},
handlePickSuccess () {
this.$emit('on-pick-success');
2016-12-22 09:18:11 +08:00
},
handlePickClick () {
this.$emit('on-pick-click');
2016-12-19 14:44:07 +08:00
}
}
2016-12-25 22:49:42 +08:00
};