Closed Shen-Shuyi closed 1 year ago
写了一段测试代码, 但是为什么字没有变红?
import React, { useEffect, useRef, useState } from 'react' import { Layout, Menu, Button } from 'antd'; // style import { createStyles, css } from 'antd-style' const useStyles = createStyles({ head: css` color: 'red'; ` }) // style const { Content, Sider, Header } = Layout; export default function MyLayout() { const { styles } = useStyles(); return ( <Layout> <Layout> <Sider theme='light'> aaaaa </Sider> <Layout> <div ><b className={styles.head} >123</b></div> <Content style={{minHeight: '100%', backgroundColor: '#fff'}}> <Button type="primary">11</Button> </Content> </Layout> </Layout> </Layout> ) }
123始终是黑色, 打开控制台这个样式是不起作用的
解决了, red不应该加单引号
🧐 问题描述
写了一段测试代码, 但是为什么字没有变红?
123始终是黑色, 打开控制台这个样式是不起作用的![image](https://user-images.githubusercontent.com/12165540/223030730-e199c82b-59ac-4093-a592-7f810c24ab73.png)
🚑 其他信息