如何在material-ui

时间:2019-02-06 18:42:22

标签: reactjs material-ui textfield

我想在此字段的右上角添加日历图标而不是箭头图标。我该如何添加?有人可以帮我吗。enter image description here

import React from 'react';
import {InputBase, InputLabel } from '@material-ui/core';

import moment from 'moment';

export class DateComp extends React.Component {
    constructor() {
        super();
    this.state= {
        dates: moment(new Date()).format('YYYY-MM-DD').toString()
    }
}
render() { 
    return(
        <div>
            <div style={{position:'relative'}}>
                <InputLabel shrink htmlFor="endDate" style={{position:'absolute', top: '0px'}} >
                End Date
                </InputLabel>
                <InputBase
                    id="endDate-input"
                    type="date"
                    defaultValue={this.state.dates}
                    style={
                        {
                            borderStyle:'solid', 
                            borderRadius:'4px',
                            borderWidth: '1px',
                            borderColor:'#cfcfcf',
                            paddingLeft:'15px',
                            marginTop: '17px'
                        }
                    }
                />
            </div>
        </div>
    )
}

}

0 个答案:

没有答案