zoukankan      html  css  js  c++  java
  • antd----react css框架

    安装  npm install antd --save

    1.安装依赖:npm install react-app-rewired customize-cra babel-plugin-import less less-loader
                2.修改package.json
                        ....
                            "scripts": {
                                "start": "react-app-rewired start",
                                "build": "react-app-rewired build",
                                "test": "react-app-rewired test",
                                "eject": "react-scripts eject"
                            },
                        ....
                3.根目录下创建config-overrides.js
                        //配置具体的修改规则
                        const { override, fixBabelImports,addLessLoader} = require('customize-cra');
                        module.exports = override(
                            fixBabelImports('import', {
                                libraryName: 'antd',
                                libraryDirectory: 'es',
                                style: true,
                            }),
                            addLessLoader({
                                lessOptions:{
                                    javascriptEnabled: true,
                                    modifyVars: { '@primary-color': 'green' },
                                }
                            }),
                        );
                    4.备注:不用在组件里亲自引入样式了,即:import 'antd/dist/antd.css'应该删掉
                     import { Button,DatePicker } from 'antd';
                     import {WechatOutlined,WeiboOutlined,SearchOutlined} from '@ant-design/icons'
                     const { RangePicker } = DatePicker;
  • 相关阅读:
    在.NET访问MySql数据库时的几点经验(转)
    FxCop代码标准检测工具
    ASP(从前) vs ASP.NET(之后)
    NET本质论_读书笔记(1)
    WinDbg配置和使用基础(转)
    ASP.NET 2.0中CSS失效的问题总结(转)
    【下载】.NET Framework 源代码
    IL代码底层运行机制(转)
    asp.net水晶报表的一些问题
    Javascript 刷新框架及页面的方法总集
  • 原文地址:https://www.cnblogs.com/sunmarvell/p/14454121.html
Copyright © 2011-2022 走看看