@yzfe/yz-nerv-ui

    1.0.54 • Public • Published

    yz-nerv-ui 基于 nerv 的一套 PC 通用 ui 库

    Getting Started

    install 安装

    yarn add @yzfe/yz-nerv-ui
    
    or
    
    npm install @yzfe/yz-nerv-ui
    

    Usage 用法

    yz-nerv-ui's components can ben import in es6 way. import {Button} from '@yzfe/yz-nerv-ui'

    And import style manually:

    import '@yzfe/yz-nerv-ui/dist/index.css'

    Import on Demand 按需加载

    按需加载情况下,你可以这样引入组件:

    import Button from '@yzfe/yz-nerv-ui/lib/Button'
    
    import '@yzfe/yz-nerv-ui/lib/Button/style/index.css'

    或者

    import { Button } from '@yzfe/yz-nerv-ui'
    
    import '@yzfe/yz-nerv-ui/lib/Button/style/index.css'

    当然,我们更加建议您使用babel-plugin-import来进行按需加载,加入插件后,您可以这么写:

    1.在项目入口文件引入项目公共样式

    import '@yzfe/yz-nerv-ui/lib/index.common.css'

    2.在需要用到组件的文件中引入组件:

    import { Button } from '@yzfe/yz-nerv-ui'
    yarn add babel-plugin-import -D  or npm i babel-plugin-import -D

    3.在 webpack babel-loader 添加插件:

    plugins: [
        [
            'import',
            {
                libraryName: '@yzfe/yz-nerv-ui',
                libraryDirectory: 'lib',
                style: name => {
                    return `${name}/style/index.css`
                }
            }
        ]
    ]

    License

    MIT

    Keywords

    none

    Install

    npm i @yzfe/yz-nerv-ui

    DownloadsWeekly Downloads

    5

    Version

    1.0.54

    License

    ISC

    Unpacked Size

    1.63 MB

    Total Files

    49

    Last publish

    Collaborators

    • allenice
    • allenmo
    • vfasky