You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
590 B
21 lines
590 B
5 years ago
|
import Icon from '../icon';
|
||
|
import { isValidElement } from '../_util/props-util';
|
||
|
import { cloneElement } from '../_util/vnode';
|
||
|
|
||
|
export default {
|
||
|
functional: true,
|
||
|
render(h, context) {
|
||
|
const { props } = context;
|
||
|
const { suffixIcon, prefixCls } = props;
|
||
|
return (
|
||
|
(suffixIcon && isValidElement(suffixIcon) ? (
|
||
|
cloneElement(suffixIcon, {
|
||
|
class: `${prefixCls}-picker-icon`,
|
||
|
})
|
||
|
) : (
|
||
|
<span class={`${prefixCls}-picker-icon`}>{suffixIcon}</span>
|
||
|
)) || <Icon type="calendar" class={`${prefixCls}-picker-icon`} />
|
||
|
);
|
||
|
},
|
||
|
};
|