Skip to content

Dilomen/serein-ui

Repository files navigation

开始

项目网站:http://component.dilomen.com/

安装

npm install -D serein_ui
yarn add -D serein_ui

使用

import {Modal} from 'serein_ui'
import 'serein_ui/es/index.css'
ReactDOM.render(<Modal visible={true}>Hello Serein</Modal>, document.getElementById('root'));

按需加载

yarn add -D serein-import
npm install -D serein-import
const sereinImport = require("serein-import");
// 然后配置"babel"的plugins就大功告成了

{
    test: /\.jsx?$/,
    exclude: /node_modules/,
    use: [
        {
            loader: "babel-loader",
            options: {
                presets: ["@babel/preset-env", "@babel/preset-react"],
                plugins: [
                    [
                        sereinImport,
                        { libraryName: "serein_ui", libraryDirectory: "es"},
                    ],
                ],
            },
        },
    ],
},

// 代码就会被转化成指定的路径

import { Button } from 'serein_ui';

会被转化为

import Button from 'serein_ui/es/Button/index.js
import 'serein_ui/es/Button/index.css

About

一套react搭建的UI组件库

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages