# hsuicomponent

> a public component Library from Huya-Base-Fed was base on Vue.js

Latest version **0.0.1** (published 2019-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install hsuicomponent
pnpm add hsuicomponent
yarn add hsuicomponent
bun add hsuicomponent
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-07-08 |
| First published | 2019-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 6.0.0 |
| Dependencies | 0 |
| Unpacked size | 47.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hh |
| Maintainers | wohev6 |
| Keywords | vue, components, hbf |

## Links

- npm: https://www.npmjs.com/package/hsuicomponent
- Repository: https://github.com/huya-base-fed/public-components
- Homepage: https://github.com/huya-base-fed/public-components#readme
- Issues: https://github.com/huya-base-fed/public-components/issues
- npm.io page: https://npm.io/package/hsuicomponent

## Recent versions

- 0.0.1 (latest) — 2019-07-08

## README

# PublicComponents

基于 `Vue.js` 的公共组件仓库，使用 webpack 搭建一个 library 脚手架可以参考这个仓库的源码。

## npm 安裝 / yarn

```bash
npm i hbf-public-components --save-dev
```

```bash
yarn add hbf-public-components -D
```

## 引入方式

### Script 标签

将打包后的文件放到自己的 CDN 上面，然后引入

```html
<script src="https://你的CDN地址/hbf.min.js"></script>
<script>
  console.log(window.Hbf)  // 打印你导出的对象
</script>
```

### 全量引入

```javascript
// main.js
import Vue from 'vue'
import hbf from 'hbf-public-components'

Vue.use(hbf) // 会执行hbf的install方法，内部全部组件全局注册
```

### 按需引入

首先安装`babel-plugin-import`

```bash
yarn add babel-plugin-import -D
```

配置`.babelrc`

```javascript
"plugins": [
  ["import", {
    "libraryName": "hbf-public-components",
    "libraryDirectory": "lib/components"
  }]
]
```

使用`webpack-bundle-analyzer`可以查看模块按需引入的打包依赖图。

## 引入公共组件示例

```
<template>
  <public-menu :data="xxx">
  </public-menu>
</template>

import { publicMenu } from 'hbf-public-components'

export default {
  components: {
    publicMenu,
  },
}
```

## 公共组件编写

参考 [组件编写约定](https://github.com/huya-base-fed/public-components/blob/master/lib/README.md)

---
_Source: https://npm.io/package/hsuicomponent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
