Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于表单组件和列表组件的样式不统一问题建议尽快修正. #23

Open
ghost opened this issue Nov 28, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 28, 2016

图中, 表单组件与列表组件的默认字号,行高度,左侧边距(我增加属性偏移了6个单位),不一致.
image

修改OK,请通知我一下.

@2999
Copy link
Collaborator

2999 commented Dec 1, 2016

@xttianma 能否把你的代码贴到这里?

@ghost
Copy link
Author

ghost commented Dec 2, 2016

表单组件和list的默认样式, 不一样..... (高度,字体大小, 右侧图标大小), 还需要提交代码吗?

@ghost
Copy link
Author

ghost commented Dec 2, 2016

用 TextField 的组件(所有表单的组件高度一致,字号一致...)
export class TextInput extends React.Component {

constructor(props) {
    super(props);
    this.state = {  value: null };
}

handleTextChange(value) {
    let t = this;
    t.setState({  value: value });
    t.props.handleChange(value,this.props.label);
};

render() {
    return (
        <TextField 
            label={this.props.label} 
            placeholder={'请输入'+this.props.label+'...'} 
            value={this.state.value}                     
            onChange={this.handleTextChange.bind(this)}
        />
    );
}

}

用list 的组件:
export class DateSelect extends React.Component {

constructor(props) {
    super(props);
    this.state = { value: null };
}

handleClick() {
    dd.ready(()=>{
        dd.biz.util.datepicker({
            format: 'yyyy-MM-dd',
            value: '', //默认显示日期
            onSuccess : (result)=> {                
                this.setState({  value: result.value });        
                this.props.handleChange(result.value ,this.props.label);
            },
            onFail : function() {}
        })
    });
};

render() {
    return (         
        <List className="t-FS20 t-PL6"
            onClick={this.handleClick.bind(this)}
            data={[{
                title : this.props.label,
                date : this.state.value
            }]}
        /> 
    );
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant