1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/open-hand-choerodon-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
index.tsx 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
HughHzWu Отправлено 3 лет назад acf16fd
import React, { Component, CSSProperties, ReactNode } from 'react';
import Icon from '../icon';
import RcRate from '../rc-components/rate';
import ConfigContext, { ConfigContextValue } from '../config-provider/ConfigContext';
export interface RateProps {
prefixCls?: string;
count?: number;
value?: number;
defaultValue?: number;
allowHalf?: boolean;
allowClear?: boolean;
disabled?: boolean;
onChange?: (value: number) => any;
onHoverChange?: (value: number) => any;
character?: ReactNode;
className?: string;
style?: CSSProperties;
}
export default class Rate extends Component<RateProps, any> {
static displayName = 'Rate';
static get contextType(): typeof ConfigContext {
return ConfigContext;
}
static defaultProps = {
character: <Icon type="star" />,
};
context: ConfigContextValue;
private rcRate: any;
focus() {
this.rcRate.focus();
}
blur() {
this.rcRate.blur();
}
saveRate = (node: any) => {
this.rcRate = node;
};
render() {
const { getPrefixCls } = this.context;
return <RcRate ref={this.saveRate} prefixCls={getPrefixCls('rate')} {...this.props} />;
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/open-hand-choerodon-ui.git
git@gitlife.ru:oschina-mirror/open-hand-choerodon-ui.git
oschina-mirror
open-hand-choerodon-ui
open-hand-choerodon-ui
master