我的反应组件没有显示日历图标,甚至没有正确使用css来选择日期。 导入声明:
import 'bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css';
import 'bootstrap-datepicker/dist/js/bootstrap-datepicker.min';
输入元素属性:
var elementProps = {
id: this.props.unique,
type: "text",
placeholder: this.props.placeholderText,
className: this.props.className,
onSelect: this.onSelect,
//readOnly: "true"
};
渲染:
render() {
return(
<div className="form-group">
{this.renderLabel()}
<div id={this.state.inputDateGroupId} className="input-group date">
{React.createElement("input",this.state.elementProps)}
<span className="input-group-addon"><span className="glyphicon glyphicon-calendar"></span></span>
</div>
</div>
)
}
预期的O / P:
我甚至尝试<i className="glyphicon glyphicon-calendar"></i>
替代<span>