问题描述
我需要一些帮助才能将此 useStyles 设置转换为样式组件。我只是不确定“& 行”是指道具还是布尔值?没见过
alternativeLabel: {
top: 18,},active: {
"& $line": {
backgroundColor:
check === 1
? theme.colors.warning
: check === 2
? theme.colors.primary
: theme.colors.primary,completed: {
"& $line": {
backgroundColor:
check === 1
? theme.colors.warning
: check === 2
? theme.colors.warning
: theme.colors.primary,line: {
height: 3,border: 0,backgroundColor: "#eaeaf0",borderRadius: 1,})(StepConnector);
return <ColorlibConnector />;
};
我尝试了一些与此类似的想法,但遇到了一些麻烦
const Connector = styled(StepConnector)`
${({ alternativeLabel }) => alternativeLabel && `top: 18;`}
${({ active,line }) =>
active && line && `backgroundColor: ${theme.colors.primary};`}
${({ completed,line }) =>
completed && line && `backgroundColor: ${theme.colors.primary};`}
${({ line }) =>
line && `height:3px; border: 0; background-color: #eaeaf0; border-radius:1px`}
${({ isMobile }) => (isMobile && `width: 2px;`) || `width: 20px;`}
`;
提前致谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)