# vue-router-return

> A Vue component to router return page

Latest version **1.0.12** (published 2020-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-router-return
pnpm add vue-router-return
yarn add vue-router-return
bun add vue-router-return
```

## 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.12 |
| Published | 2020-05-16 |
| First published | 2020-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 169.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | illusionR |
| Maintainers | illusionriver |
| Keywords | vue, router, return |

## Links

- npm: https://www.npmjs.com/package/vue-router-return
- Homepage: https://github.com/echo-lu/mini-sliders/blob/master/README.md
- npm.io page: https://npm.io/package/vue-router-return

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.11

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.12 (latest) — 2020-05-16
- 1.0.11 — 2020-05-15
- 1.0.10 — 2020-05-12
- 1.0.9 — 2020-05-12
- 1.0.8 — 2020-05-11
- 1.0.7 — 2020-05-11
- 1.0.6 — 2020-05-11
- 1.0.5 — 2020-05-11
- 1.0.4 — 2020-05-11
- 1.0.3 — 2020-05-11
- 1.0.2 — 2020-05-11
- 1.0.1 — 2020-05-09
- 1.0.0 — 2020-05-09

## README

# vue-router-return

> A Vue component to router return page

## Build Setup

``` bash
# install dependencies
npm install vue-router-return

# uninstall dependencies
npm uninstall vue-router-return

```

## 参数配置
**pageReturnName**：页面名称<br>
**pageReturnName**：page name

## 实例
首先在项目的入口文件（main.js）中引入<br>
First, import plugin with main.js.
``` 
import vueRouterReturn from 'vue-router-return'
Vue.use(vueRouterReturn) 
```

1、在激活当前页面时，当前前页面增加到路由数组中<br>
1, When actived page, put the current page into router array.
``` 
vueRouterReturn.addRouter('inquiry');
```
2、当点击返回上一页面时，跳转页面之后的页面名称从路由数组中删除<br>
2, When click return button, the page after the jump page will be deleted from the route array.
```
      goback() {
        //this.pageReturnName 需要返回的页面Name，不存在则返回上一级页面
        if (this.pageReturnName) {
          //当前返回页面是否存在，存在则删除之后面的路由数组页面并跳转；如果存在，但不为-1，起始页面，不操作
          if (vueRouterReturn.findRouterName(this.pageReturnName) !== -1) {
            this.$router.go(-vueRouterReturn.findRouterName(this.pageReturnName));
            vueRouterReturn.removeRouter(this.pageReturnName);
          }
        } else {
          this.$router.go(-1);
        }

      }
```

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