小编Jam*_*bla的帖子

如何将 MaterialUI TextField 的值设置为大写?

我有一个 Material UI TextField 作为输入,我需要强制输入的文本为大写。我曾尝试使用textTransform: "uppercase"作为样式属性的一部分,但这似乎不起作用。我的组件中的所有其他样式都已正确应用,但 textTransform 却没有。

我还尝试使用标准样式方法将我的样式作为道具传递给组件,但我得到了相同的结果。

我的组件:

  const MenuInput = (props) => {
  const useStyles = makeStyles((theme) => ({
    input: {
      textTransform: "uppercase",
      marginTop: "10px",
      width: "100%",
      borderRadius: 4,
      backgroundColor: "#FFFFFF",
    },
  }));

  const classes = useStyles();
  return (
    <TextField
      className={classes.input}
      id={props.id}
      color="primary"
      label={props.label}
      variant="filled"
      onChange={(e) => props.onChange(e)}
      error={props.isError}
      helperText={props.error}
    />
  );
};
Run Code Online (Sandbox Code Playgroud)

输出:

文本字段的输出

styles input textfield reactjs material-ui

7
推荐指数
2
解决办法
1万
查看次数

如何访问 terraform 根模块之外的文件夹?

我正在尝试使用 terraform 部署 lambda。lambda 模块中的步骤之一会压缩 lambda 的源文件夹。但是,当我运行以下代码时,我遇到了此错误:
Error: error archiving directory: could not archive missing directory: ./../hello-world

这是我当前的文件夹结构

文件夹结构

这是我的 zip 步骤的 lambda terraform:

data "archive_file" "lambda_hello_world" {
  type = "zip"

  source_dir  = "${path.root}/../hello-world"
  output_path = "${path.root}/../hello-world.zip"
}
Run Code Online (Sandbox Code Playgroud)

管道代码:

name: Deploy Infrastructure

on:
  push:
    branches:
      - master

jobs:
  terraform:
    name: 'Terraform'
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: './terraform/'
    steps:

    - name: Checkout Repo
      uses: actions/checkout@v3

    - name: Setup Terraform
      uses: hashicorp/setup-terraform@v1
      with:
        # terraform_version: 0.13.0
        cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

    - name: Terraform …
Run Code Online (Sandbox Code Playgroud)

lambda zip module terraform

6
推荐指数
0
解决办法
2679
查看次数

标签 统计

input ×1

lambda ×1

material-ui ×1

module ×1

reactjs ×1

styles ×1

terraform ×1

textfield ×1

zip ×1