迎月兮

关注

react 使用styled-componts

迎月兮

关注

阅读 3

2024-06-30

一、安装

npm i styled-components

二、直接使用

import React from 'react'
import styled from 'styled-components'
const Node = styled.div`
    color:red;
`

export default function(){
    return (
        <Node>
            this is test content
        </Node>
    );
};

三、官网

https://styled-components.com/docs/basics#getting-started

相关推荐

sullay

React项目中使用 styled-components

sullay 64 0 0

大漠雪关山月

React--》掌握styled-components重塑React样式管理

大漠雪关山月 27 0 0

单调先生

react typescript封装函数式组件styled-component

单调先生 71 0 0

大师的学徒

在 Vue3 中使用 styled-components

大师的学徒 10 0 0

点亮自己的那盏灯

在create-react-app中MUI(material-ui)使用styled-component 作为样式引擎

点亮自己的那盏灯 67 0 0

迎月兮

react——css-in-js——styled-components库——定义样式——样式继承——属性传递

迎月兮 112 0 0

半秋L

styled-component 使用三 Style Objects,Theme, GlobalStyle

半秋L 88 0 0

千行

前端项目实战肆佰贰拾壹react-admin和material ui-@emotion/styled操作

千行 21 0 0

洲行

styled-components 基础使用一[css, extend,attrs,&&,as,withComponent]

洲行 109 0 0

phpworkerman

styled-components覆盖antD Layout样式

phpworkerman 135 0 0

精彩评论(0)

0 0 举报