css - 如何更正 CSS 文件中的 $ 标记?
问题描述
我的项目中有 CSS const,然后在显示错误的最后一行插入“$”符号。我该如何解决?
const NavBox = (props: { children: React.ReactNode }) => { return (
<div
css={css`
display: flex;
height: 100%;
justify-content: flex-end;
align-items: center;
@media (max-width: 768px) {
flex-direction: column;
position: fixed;
width: 100%;
justify-content: flex-start;
padding-top: 10vh;
background-color: #fff;
transition: all 0.3s ease-in;
top: 8vh;
left: ${props => (props.open ? "-100%" : "0")};
}
`}
{...props}
></div>
) }
解决方案
删除 lambda 并执行以下操作:
left: ${props.open ? "-100%" : "0"};
推荐阅读
- spring-boot - 将属性值设置为 YAML 配置 spring boot 中另一个属性的一部分
- android - Android 中的最佳实践双窗格仅使用 Android 中的 1 个活动和两个片段
- c - 根据在 C 中声明的顺序释放结构的元素时出错
- google-apps-script - 处理来自响应的可变数据集
- jquery - 如何检查滚动时变量值是增加还是减少?
- swift - 在我的情况下通过协议类型访问变量
- javascript - 更新数据后覆盖的 D3JS 换行文本插件
- active-directory - 通讯组成员未收到电子邮件
- outlook - 是否可以创建 Outlook 报告(如果可以,如何创建)
- python - 如何在 DDD 中创建管道流程?