2023年6月20日发(作者:)

react-hooks:CSSProperties1、定义变量const divStyle: perties = { width: "11rem", height: "7rem", backgroundColor: `rgb(${},${}, ${})` };使⽤:

2、定义函数interface SidebarProps { isVisible: boolean;}const divStyle = (props: SidebarProps): perties=>({ width: ble ? "23rem" : "0rem"})export const SidebarComponent: essComponent = props => (
{ble}
)const divStyle = (props: SidebarProps): perties=>({ width: ble ? "23rem" : "0rem"})返回值为perties类型

2023年6月20日发(作者:)

react-hooks:CSSProperties1、定义变量const divStyle: perties = { width: "11rem", height: "7rem", backgroundColor: `rgb(${},${}, ${})` };使⽤:

2、定义函数interface SidebarProps { isVisible: boolean;}const divStyle = (props: SidebarProps): perties=>({ width: ble ? "23rem" : "0rem"})export const SidebarComponent: essComponent = props => (
{ble}
)const divStyle = (props: SidebarProps): perties=>({ width: ble ? "23rem" : "0rem"})返回值为perties类型