小编gos*_*kan的帖子

Material-UI Grid 在使用 Display 时不会隐藏

我想使用 MUI Grid https://material-ui.com/api/grid/,如果屏幕很小,我想隐藏一项 Grid,所以我找到了一个叫做 Display 的东西https://material-ui.com/system/display/。我的代码看起来像这样

function CRUDView() {
  return (
    <Grid
      container
      spacing={1}
      direction="row"
      justify="center"
      alignItems="center"
    >
      <Grid item xs={12} lg={6}>
        <span>XX</span>
      </Grid>
      <Grid item xs={6} display={{ xs: "none", lg: "block" }} >
        <span>YY</span>
      </Grid>
    </Grid>
  );
}

Run Code Online (Sandbox Code Playgroud)

我不明白为什么它不起作用(文本YY仍然出现)。我不能在 Grid 中使用 display 吗?如果是,那为什么?

reactjs material-ui

8
推荐指数
3
解决办法
1万
查看次数

使用 C# 在 Excel 中设置货币格式

我有一个 C# 模型

    public class Model
    {
        public int CurrencyId{ get; set; }
        public decimal? ValueMoney{ get; set; }
    }
Run Code Online (Sandbox Code Playgroud)

并从数据库我收到 List<Model>

我想在 Excel 工作表中以货币格式编写 ValueMoneys,根据 CurrencyId,它必须是美元 $ 或巴西雷亚尔 R$。

我正在使用 Microsoft.Office.Interop.Excel;

我的代码如下所示:

var data = GetValues().ToList();
Application xlApp = new Application();
Workbook xlWorkBook = null;
Worksheet xlWorkSheet = xlWorkBook.Worksheets[1];

for (int i = 1; i < data.count; i++){
     xlWorkSheet.Cells[i, 1] = data[i].ValueMoney!= null ? data[i].CurrencyId == 2 ? data[i].ValueMoney.Value.ToString("C", new CultureInfo("pt-BR")) : data[i].ValueMoney.Value.ToString("C", new CultureInfo("en-US")) : "";       
    ((Range)xlWorkSheet.Cells[i, 1]).Style …
Run Code Online (Sandbox Code Playgroud)

c# excel

5
推荐指数
1
解决办法
6305
查看次数

将Dictionary转换为Numpy数组

我正在尝试转换字典

{0: {0: 173, 1: 342, 2: 666, 3: 506, 4: 94},
 1: {0: 13, 1: 2171, 2: 1915, 3: 3075, 4: 630},
 2: {0: 0, 1: 265, 2: 5036, 3: 508, 4: 11},
 3: {0: 0, 1: 3229, 2: 2388, 3: 3649, 4: 193},
 4: {0: 3, 1: 151, 2: 591, 3: 1629, 4: 410}}
Run Code Online (Sandbox Code Playgroud)

numpy数组

array([[ 173,  342,  666,  506,   94],
       [  13, 2171, 1915, 3075,  630],
       [   0,  265, 5036,  508,   11],
       [   0, 3229, 2388, 3649, …
Run Code Online (Sandbox Code Playgroud)

python dictionary numpy python-3.x numpy-ndarray

4
推荐指数
1
解决办法
2461
查看次数

如何在react-select中设置helperText

我正在使用react-selectTextField Material-UI。是否有可能设置helperText(组件下方的小文本),react-select就像它是在其中制造的一样TextField

提前感谢您的帮助。

PS 我不认为我的问题是这个问题的重复。另一篇文章是关于如何自定义作为 react-select 一部分的组件,我想添加一个 react-select 没有的选项。

reactjs react-select material-ui

2
推荐指数
2
解决办法
5822
查看次数

URLSearchParams 可以让参数不区分大小写吗?

可以URLSearchParams以某种方式找到参数而不区分大小写吗?例如在查询中我有?someParam=paramValue,那么什么时候我 URLSearchParams.get("someparam")会找到paramValue

javascript query-parameters reactjs

1
推荐指数
1
解决办法
496
查看次数