@nextlc/react-component
TypeScript icon, indicating that this package has built-in type declarations

1.3.20 • Public • Published
React UI 组件库

使用

  • 一次引入完整样式
import React from "react"
import { HelloWorld } from "reactcomponents"
import "reactcomponents/dist/main.min.css"
  • 按需加载: 手动加载样式模块
import React from "react"
import { HelloWorld } from "reactcomponents"
import "reactcomponents/lib/HelloWorld/style"
  • 按需加载: 通过 babel-plugin-import 实现
// babel babel-plugin-import 插件配置: 创建多个 babel-plugin-import 实例
module.exports = {
  plugins: [
    ["babel-plugin-import", {
      libraryName: "reactcomponents",
      libraryDirectory: "es",
      camel2DashComponentName: false, // 是否需要驼峰转短线
      camel2UnderlineComponentName: false, // 是否需要驼峰转下划线
      style: true, // 动态加载相应组件的样式,'css'取css.js,true取index
    },'reactcomponents'],
  ]
}
// 按需引入组件
import React from "react"
import { HelloWorld } from "reactcomponents"

本地开发

  • 运行开发环境
npm install
npm start
  • 编译 npm 包
npm run build
  • 发布 npm 包
npm run pub

Readme

Keywords

Package Sidebar

Install

npm i @nextlc/react-component

Weekly Downloads

0

Version

1.3.20

License

ISC

Unpacked Size

3.17 MB

Total Files

181

Last publish

Collaborators

  • shenck