# pit-bimwin-react-ui

基于 tsdx, 整合 storybook, less, sass

基于 Typescript 语法, 创建 Npm 组件

## 目录说明

```
src                     # 源代码目录
|-assets                # 静态文件目录
|-hooks                 # 自定义钩子函数目录
|-components            # 内置的业务组件目录
|-core                  # 初始化bimwin-api
|-PitBimwinApp.tsx      # 主容器
|-index.config.ts       # ts配置文件
|-index.tsx             # 只有在该文件导出的组件,才能被用户引用
|-useBtnOpt.ts          # 操作按钮及其他配置项
stories                 # storybook目录
example                 # 自行调用实验目录(基于parcel)
main.ts                 # storybook配置文件
manager.js              # storybook配置文件
YourTheme.js            # storybook配置文件
tsdx.config.js          # tsdx配置文件
tsconfig.json           # ts配置文件
```

## 使用说明

> 运行

```bash
npm start # or yarn start
```

> 运行 dome

```bash
cd ./example
```

> 在 example>目录下运行

```bash
npm start # or yarn start
```

```
http://localhost:1234  // 3d
http://localhost:1234/2d // 2d
http://localhost:1234/two // 3d and 2d

```

## 全局属性

| 参数名         | 类型   | 描述                     | 参数 |
| -------------- | ------ | ------------------------ | ---- |
| options        | object | 属性配置（具体请看下表） |      |
| headers        | object | 1                        | 1    |
| visibleToolbar | array  | -                        | -    |

### options 属性字段说明

| 参数名 | 类型   | 描述     | 参数 |
| ------ | ------ | -------- | ---- |
| url    | string | 主机地址 | ''   |
| fileId | string | 模型 id  |      |

## 命令说明

### 运行 tsdx 的监听

```bash
npm start # or yarn start
```

### 执行 tsdx 打包

```bash
npm build # or yarn build
```

### 运行 storybook

```bash
npm storybook # or yarn storybook
```

### storybook 打包

```bash
npm build-storybook # or yarn build-storybook
```

## 将组件上传 npm

```bash
yarn build
npm login # npm登录
npm pub # 组件发布
```
