Bootstrap DatePicker不显示日历图标

时间:2017-09-29 20:02:59

标签: reactjs npm bootstrap-datepicker

我的反应组件没有显示日历图标,甚至没有正确使用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:

enter image description here

结果: enter image description here

我甚至尝试<i className="glyphicon glyphicon-calendar"></i>替代<span>

0 个答案:

没有答案
相关问题