UNPKG

cjd-parkball

Version:

> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用

40 lines (30 loc) 612 B
--- category: 2 title: 文案展现 title_en: Show copywriting --- zh-CN 给评分组件加上文案展示。 en-US Add copywriting in rate components. ````jsx import { Rate } from 'parkball'; class Rater extends React.Component { state = { value: 3, } handleChange = (value) => { this.setState({ value }); } render() { const { value } = this.state; return ( <span> <Rate onChange={this.handleChange} value={value} /> {value && <span className="ant-rate-text">{value} stars</span>} </span> ); } } ReactDOM.render(<Rater />, mountNode); ````