我正在使用 styled-components 庫來設計我的應用程式。我遇到的問題是,例如,當我創建了一個 Container 并且我想在鍵入字體時在其中插入 CSS 時,它沒有像我通常在 CSS 中那樣提供可供選擇的屬性串列(字體大小, font-weight...),我應該手工撰寫所有CSS屬性。
<-- 應用組件-->
import styled from 'styled-components';
//styled Components
const AppContainer = styled.div`
CSS HERE
`;
function App() {
return (
<AppContainer>
<h1>Hello Gallery</h1>
</AppContainer>
);
}
export default App;
我應該安裝一個 VS 擴展來激活我的 jsx 檔案中的這個選項嗎?
uj5u.com熱心網友回復:
您可以嘗試https://marketplace.visualstudio.com/items?itemName=jpoissonnier.vscode-styled-components用于樣式的自動建議和自動完成。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/329670.html
上一篇:如何在頁面重新加載時從localStorage獲取資料
下一篇:React基于物件初始化狀態
