【问题标题】:How to append a button to TextField in Material UI如何在 Material UI 中将按钮附加到 TextField
【发布时间】:2021-11-14 07:55:26
【问题描述】:

如何在引导输入组中将按钮附加到 TextField?

这个我试过了,但是太丑了:

<TextField fullWidth
            variant="outlined"
            label="Add Something"
            InputProps={
                {
                    endAdornment: (
                        <InputAdornment position="end">
                            <Button
                                aria-label="Add"
                                edge="end"
                                color="primary"
                                variant="contained"
                            >
                                ADD
                            </Button>
                        </InputAdornment>
                    )
                }
            }
/>

【问题讨论】:

    标签: reactjs material-ui styles


    【解决方案1】:
    <FormGroup row>
      <TextField variant="outlined" placeholder="username" />
      <Button variant="contained" disableElevation>
        @example.com
      </Button>
    </FormGroup>
    

    【讨论】:

      猜你喜欢
      • 2020-10-05
      • 1970-01-01
      • 2021-07-07
      • 2021-09-12
      • 2016-06-24
      • 2021-02-15
      • 2020-06-08
      • 2020-10-03
      • 2018-12-03
      相关资源
      最近更新 更多