【问题标题】:How to I solve formatting problem on vscode for react?如何解决 vscode 上的格式化问题以进行反应?
【发布时间】:2022-02-10 04:58:27
【问题描述】:

我已经开始看 React 教程了。

我确实有问题,vscode 没有格式化样式常量。 另外,如果我想写 fs14 或 fs 它不会向我推荐任何东西。

const Container = styled.div`
width: 100%;
height: 100vh;
display: flex;
position: relative;
background-color: coral;

`

const Arrow = styled.div`

    width: 50px;
    height: 50px;
    background-color: #fff7f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    bottom: 0;
    left: ${(props) => props.direction === "left" && "10px"};
    right: ${(props) => props.direction === "right" && "10px"};
    margin: auto;
`


格式化文件后,容器保持不变。 另外,如果我想写 fs/fs14 例如它不推荐我的 font-size => font-size: 14;

请帮忙? :D

【问题讨论】:

  • 您的帖子标题对于搜索用户来说不是很不稳定。这是非常普遍的。我希望你的帖子的编辑纠正这个。

标签: javascript css reactjs visual-studio-code


【解决方案1】:

尝试安装 styled components 扩展,看看是否能解决问题https://marketplace.visualstudio.com/items?itemName=styled-components.vscode-styled-components

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 2019-02-12
    • 2018-05-06
    • 2023-02-05
    • 1970-01-01
    • 1970-01-01
    • 2016-07-02
    相关资源
    最近更新 更多