# web-widget

> 前端UI组件库

[![NPM](https://img.shields.io/npm/v/web-widget.svg)](https://www.npmjs.com/package/web-widget) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## 使用npm安装

```bash
npm install --save web-widget
```

## 使用yarn安装

```bash
yarn add web-widget
```

## 发包
```bash
npm publish
```

## 示例

```tsx
import React from 'react'
import ReactDOM from 'react-dom'

import { Button } from 'web-widget'

const Example: React.FC = () => {
  return (
    <Button type="primary">我是按钮</Button>
  )
}

ReactDOM.render(<Example />, document.getElementById('root'))
```

## 按需加载
```javascript
[
  'import',
  {
    libraryName: 'web-widget',
    transformToDefaultImport: false,
    camel2DashComponentName: false,
    customName: (name) => {
      const widget = name === 'them'
        ? name
        : name.endsWith('Icon') ? 'icons' : 'components' + `/${name}/${name}`
      return `web-widget/dist/es/${widget}`
    }
  },
  'web-widget'
]
```

## License

Apache-2.0 © Ellite
