小编Ped*_*vas的帖子

Material-UI - 理解 10px 简化

我不明白为什么我们需要这样做来简化 10px:

html {
   font-size: 62.5%; /* 62.5% of 16px = 10px */
}
Run Code Online (Sandbox Code Playgroud)

下面的代码不应该完成所有的工作吗?

const theme = createMuiTheme({
  typography: {
    // Tell Material-UI what's the font-size on the html element is.
    htmlFontSize: 10,
  },
});
Run Code Online (Sandbox Code Playgroud)

先感谢您。

css themes font-size reactjs material-ui

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

如何运行Storybook控件中的功能?

我有一个组件,它有一个可以单击的按钮。它得到了它的道具,开始吧:

...
<Button id="buttonAddTreatments" 
   color={colorOfTheButton}
   variant="contained" 
   onClick={onAddClick}
   disabled={disableButton}>
     <AddIcon></AddIcon>
</Button>
...
Run Code Online (Sandbox Code Playgroud)

然后,当我将其加载到 Storybook 中时,我尝试使用onClickControls 附加组件在 上键入一个函数,如下所示:

在此输入图像描述

不幸的是,它根本不起作用。我做错了什么?

javascript controls function add-on storybook

5
推荐指数
0
解决办法
1291
查看次数

Chart.js - “options.legend.position”的类型在这些类型之间不兼容

我想将图例放在图形下面(这很简单),但是代码根本不起作用,给我以下错误:

The types of 'options.legend.position' are incompatible between these types.
Type 'string' is not assignable to type '"bottom" | "left" | "right" | "top" | "chartArea" | undefined'.
Run Code Online (Sandbox Code Playgroud)

更糟糕的是,我在 CodeSandBox 中得到了相同的代码,没有任何区别,并且运行良好......这是它的链接:https://codesandbox.io/s/spring-hill-3nme9 ?file=/src/components /Scatter.tsx

有什么帮助吗?谢谢!

charts graph legend typescript

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