ucf-web 内置组件库,无需单独安装,默认集成Tinper-Bee,如果想单独安装可以参考如下:

安装组件库

  1. npm install tinper-bee --save

使用组件库

  1. import { Button } from 'tinper-bee';
  2. class App extends Component {
  3. handlerClick = (e) => {
  4. console.log(e);
  5. }
  6. render() {
  7. return (<Button colors="success" onClick={this.handlerClick} >按钮</Button>)
  8. }
  9. }

tinper-bee 是一套基于 React.js 的开源组件库,它从丰富的企业级中后台应用场景中实战沉淀而来,为复杂应用的快速开发提供一致性 UI 解决方案。

更加详细的组件开发文档请访问:http://bee.tinper.org/

脚手架默认已经集成了该组件库

如何获取组件

推荐使用npm管理整个项目工程化

使用如下命令安装:

  1. npm install tinper-bee --save

CDN

组件也提供了CDN方式使用(不推荐)

CSS:

  1. <link href="//design.yonyoucloud.com/static/tinper-bee/[版本号]/assets/tinper-bee.css">

JS:

  1. <script src="//design.yonyoucloud.com/static/tinper-bee/[版本号]/build/tinper-bee.js"></script>

使用

  1. import React,{ Component } from 'react';
  2. import { Button,Panel } from 'tinper-bee';
  3. import 'tinper-bee/assets/tinper-bee.css';
  4. import './index.less';
  5. export default class Example extends Component{
  6. constructor(props) {
  7. super(props);
  8. }
  9. render(){
  10. return (
  11. <Panel>
  12. hello world
  13. <Button colors="info">click me</Button>
  14. </Panel>)
  15. }
  16. }