# @ezijing/vue-passport

> 基于Vue Element-UI的登录注册

Latest version **1.0.3** (published 2021-03-12) · 0 weekly downloads

## Install

```sh
npm install @ezijing/vue-passport
pnpm add @ezijing/vue-passport
yarn add @ezijing/vue-passport
bun add @ezijing/vue-passport
```

## 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.3 |
| Published | 2021-03-12 |
| First published | 2020-01-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.2 MB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | god_zyx, haodaking |
| Keywords | element-ui, vue, vue-passport |

## Links

- npm: https://www.npmjs.com/package/@ezijing/vue-passport
- npm.io page: https://npm.io/package/@ezijing/vue-passport

## Dependencies (3)

- [md5](https://npm.io/package/md5.md) ^2.3.0
- [axios](https://npm.io/package/axios.md) ^0.20.0
- [element-ui](https://npm.io/package/element-ui.md) ^2.13.2

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-03-12
- 1.0.2 — 2021-01-19
- 1.0.1 — 2021-01-18
- 1.0.0 — 2020-10-13
- 0.1.6 — 2020-10-12
- 0.1.5 — 2020-01-20
- 0.1.4 — 2020-01-06
- 0.1.3 — 2020-01-03
- 0.1.2 — 2020-01-03
- 0.1.1 — 2020-01-03
- 0.1.0 — 2020-01-03

## README

# vue-passport

## 安装

```
npm install @ezijing/vue-passport --save
```

或

```
yarn add @ezijing/vue-passport --save
```

## 使用

### 全局使用

```
import VueForm from 'vue-passport'

Vue.use(VueForm)
```

### 组件中使用

```javascript
<template>
  <vue-passport :options="options" @ready="onReady" />
</template>
<script>
import VueForm from 'vue-passport'

export default {
  components: { VueForm },
  data() {
    return {
      formModel: {
        name: ''
      },
      formItems: [
        {
          type: 'input',
          model: 'name',
          placeholder: '请输入昵称'
        }
      ]
    }
  }
}
</script>
```

## 属性

```javascript
visible: true,

showType: 1, // 0 注册，1登录，2找回密码

options: {
  // 注册
  register: {
    url: '',
    headers: {},
    data: {},
    onSuccess: function() {},
    onError: function() {}
  },
  // 登录
  login: {
    account: {
      url: '',
      headers: {},
      data: {},
      onSuccess: function() {},
      onError: function() {}
    },
    phone: {
      url: '',
      headers: {},
      data: {},
      onSuccess: function() {},
      onError: function() {}
    }
  },
  // 找回密码
  password: {
    url: '',
    headers: {},
    data: {},
    onSuccess: function() {},
    onError: function() {}
  }
}
```

## 方法

| 事件名             | 说明             | 返回值                     |
| ------------------ | ---------------- | -------------------------- |
| `register`         | 显示注册界面     |                            |
| `login`            | 显示登录界面     |                            |
| `password`         | 显示找回密码界面 |                            |
| `logout`           | 退出登录         |                            |
| `checkLoginStatus` | 检测登录状态     | function(isLogin, user) {} |

## 事件

| 事件名  | 返回值                     | 说明              |
| ------- | -------------------------- | ----------------- |
| `ready` | function(isLogin, user) {} | 组件初始化        |
| `close` | -                          | Dialog 关闭的回调 |

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