【问题标题】:change date icon alignment from right (default) to left in material-ui-pickers 2.2.4在 material-ui-pickers 2.2.4 中将日期图标对齐方式从右(默认)更改为左
【发布时间】:2019-05-23 06:31:25
【问题描述】:

我正在使用 material-ui-pickers 2.2.4 Datepicker 组件。 但是,我希望将日期图标放在左侧而不是右侧(默认)。 有什么帮助吗?

尝试了自定义 css,用 css 包装组件,所有这些 hacky 方法都失败了。

                <MuiPickersUtilsProvider utils={MomentUtils}>
                    <DatePicker 
                        readOnly
                        ref='datepicker'
                        labelFunc={this.formatWeekSelectLabel}
                        // value=""
                        onChange={this.handleDateChange}
                        animateYearScrolling
                        InputProps={{
                            disableUnderline: true,
                        }}      
                    />
                </MuiPickersUtilsProvider>
            </MuiThemeProvider>```

【问题讨论】:

    标签: material-ui


    【解决方案1】:
                   <DatePicker 
                        readOnly
                        ref='datepicker'
                        labelFunc={this.formatWeekSelectLabel}
                        // value=""
                        onChange={this.handleDateChange}
                        animateYearScrolling
                        InputProps={{
                            disableUnderline: true,
                        }}  
                        InputAdornmentProps={{ position: 'start' }}
                    />
    

    【讨论】:

    • 酷,工作:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-05
    • 2017-04-20
    • 2016-07-17
    • 1970-01-01
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多