# react-ui-lib-demo **Repository Path**: renjar/react-ui-lib-demo ## Basic Information - **Project Name**: react-ui-lib-demo - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-25 - **Last Updated**: 2021-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ui-test ## 安装 --- ### npm ```bash npm i ui-test --registry http://129.204.178.85:8080 ``` ### yarn ```bash yarn add ui-test --registry http://129.204.178.85:8080 ``` ## 使用 --- ### 直接使用 ```js // index.js import App from './app'; import 'ui-test/lib/index.css'; // …… ``` ```js // app.js import { Button } from 'ui-test'; // …… export default App; ``` ### 按需加载(`推荐`) 安装 `babel-plugin-import` ```bash npm i -D babel-plugin-import # yarn add -D babel-plugin-import ``` ```js // .babelrc.js module.exports = function (api) { api.cache(true); return { plugins: [ [ "import", { libraryName: "ui-test", style: (name) => `${name}/index.css`, }, ], ], }; }; ``` ```js import { Button } from 'ui-test'; // ↓ ↓ ↓ ↓ ↓ ↓ var _button = require('ui-test/lib/button'); require('ui-test/lib/button/index.css'); ```