# vue-public

> 前端公共组件

Latest version **1.0.2** (published 2019-09-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-public
pnpm add vue-public
yarn add vue-public
bun add vue-public
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-09-25 |
| First published | 2019-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | jiagujin |
| Maintainers | jiagujin |
| Keywords | vue, public, ui, 组件 |

## Links

- npm: https://www.npmjs.com/package/vue-public
- Repository: https://github.com/jiagujin
- npm.io page: https://npm.io/package/vue-public

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.19.0
- [element-ui](https://npm.io/package/element-ui.md) ^2.12.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-09-25
- 1.0.1 — 2019-09-25
- 1.0.0 — 2019-09-25

## README

## vue-public

> 前端公共组件

### 安装

- npm install vue-public --save

#### 如何使用\$validator

```javascript
//element 表单验证规则
 import { $validator } from "vue-public";
 Vue.prototype.$validator = $validator;
 <el-form-item prop="key" :rules=[$validator.require(),[$validator.requireChange()]></el-form-item>
```

#### 如何使用 table

```html
<el-button @click="serachList">搜索</el-button>

<common-table :queryList="queryList" :pageSize="20" ref="commonTable">
  <template slot="table">
    <!-- 表格内容定义区域 -->
    <el-table-column prop="example" label="案例"></el-table-column>
    ...
  </template>
</common-table>
```

```javascript
import { commonTable, request } from "vue-public";
export default {
   components:{
    commonTable
   }
   methods: {
     //列表请求接口
    queryList(param) {
      return request({
        url:"http://example.com",
        method: "post",
        data: {
          ...param,
          //name: this.name
        }
      });
    },
    // 列表搜索
    serachList() {
      this.$refs.commonTable.getList();
    }
  }
}
```

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