gpt4 book ai didi

reactjs - 在 VSCode 中折叠样式组件常量

转载 作者:行者123 更新时间:2023-12-03 23:27:58 24 4
gpt4 key购买 nike

我一直在 NextJS/React 中使用样式化组件,我喜欢它。通常,我将我的样式分解成单独的 js 文件,但由于我对 React、props、hook 和 context 等相对较新,我经常发现需要将我的样式保留在我的组件文件中。我的问题是如何在 VSCode 中折叠以下代码:

const SomeStyledComponent = styled.div`
height: 300px;
width: 300px;
...
`;

让我的编码生活更轻松将大有帮助。

谢谢你

最佳答案

您可以使用 indentation代码折叠策略。

// settings.json
{
// ...other settings
"editor.foldingStrategy": "indentation",
}

来自 settings doc :

Controls the strategy for computing folding ranges. auto uses a language specific folding strategy, if available. indentation uses the indentation based folding strategy.

关于reactjs - 在 VSCode 中折叠样式组件常量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59005304/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com