@aarmour/console-react-poc 中文文档教程
Installation
npm + webpack/browserify
使用 npm 安装:
$ npm install --save react react-dom @aarmour/console-react-poc
然后在您的项目中导入模块:
import React from 'react';
import ReactDOM from 'react-dom';
import { course } from '@aarmour/console-react-poc';
const { CourseList } = course;
function App(props) {
return <CourseList courses={[...]} />;
}
ReactDOM.render(<App />, document.getElementById('root'));
请注意,该项目使用 CSS 模块,因此您需要使用适当的 配置您的捆绑器加载器 或插件。 请参阅示例 以获得帮助。
UMD
umd
目录中还有一个 UMD 构建。 如果您直接从这个存储库的克隆工作,您可以使用以下方法生成 UMD 包:
$ npm run build-umd
构建一个缩小版本:
$ npm run build-min
然后在您的项目中导入模块:
// Using an es2015 transpiler
import { course } from 'umd/components';
const CourseList = course.CourseList;
// Using globals
var CourseList = window.Components.course.CourseList;
What's up with the src and lib directories?
模块源保存在 src
目录中使用 JSX
和 ES2015
编写。 为了让您不必在构建过程中添加转译步骤,我们会为您处理。 转译后的输出保存在 lib
目录中,您可以直接从那里导入模块:
import CourseList from '@aarmour/console-react-poc/lib/course/CourseList';
Running the demo locally
git clone https://github.com/aarmour/console-react-poc.git
cd console-react-poc
npm install
npm start
Acknowledgements
这个项目的构建过程改编自 rackt/react-router,版权所有 (c) 2015 Ryan Florence, Michael Jackson。
Installation
npm + webpack/browserify
Install using npm:
$ npm install --save react react-dom @aarmour/console-react-poc
Then import the module in your project:
import React from 'react';
import ReactDOM from 'react-dom';
import { course } from '@aarmour/console-react-poc';
const { CourseList } = course;
function App(props) {
return <CourseList courses={[...]} />;
}
ReactDOM.render(<App />, document.getElementById('root'));
Note that this project uses CSS Modules, so you will need to configure your bundler with the appropriate loader or plugin. See the examples for help.
UMD
There is also a UMD build in the umd
directory. If you are working directly from a clone of this repository, you can generate the UMD bundle using:
$ npm run build-umd
To build a minified version:
$ npm run build-min
Then import the module in your project:
// Using an es2015 transpiler
import { course } from 'umd/components';
const CourseList = course.CourseList;
// Using globals
var CourseList = window.Components.course.CourseList;
What's up with the src and lib directories?
The module source is kept in the src
directory and is written using JSX
and ES2015
. To spare you from having to add a transpile step in your build process, we handle it for you. The transpiled output is kept in the lib
directory, and you can import modules directly from there:
import CourseList from '@aarmour/console-react-poc/lib/course/CourseList';
Running the demo locally
git clone https://github.com/aarmour/console-react-poc.git
cd console-react-poc
npm install
npm start
Acknowledgements
The build process for this project was adapted from rackt/react-router, Copyright (c) 2015 Ryan Florence, Michael Jackson.
你可能也喜欢
- 23mofang-ui 中文文档教程
- @0x-klaytn/subproviders 中文文档教程
- @22g/tb-register 中文文档教程
- @50centnetwork/quickswap-sdk 中文文档教程
- @aarondrabeck/web-component-analyzer 中文文档教程
- @aaronshaf/panda-ui 中文文档教程
- @absaoss/ngx-inception 中文文档教程
- @accessible/disclosure 中文文档教程
- @aceandtate/contentful-ts-type-generator 中文文档教程
- @acolorbright/stylelint-config 中文文档教程