# vue-cmb-router

> ![images](https://img.shields.io/badge/vue-2.6.10-brightgreen) ![images](https://img.shields.io/badge/vue--cli-3.x-lightgrey)

Latest version **0.1.4** (published 2019-10-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-10-08 |
| First published | 2019-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lvjiaxuan |
| Maintainers | lvjiaxuan |
| Keywords | cmb app, route |

## Links

- npm: https://www.npmjs.com/package/vue-cmb-router
- Repository: https://github.com/lvjiaxuan/vue-cmb-router
- Homepage: https://github.com/lvjiaxuan/vue-cmb-router#readme
- Issues: https://github.com/lvjiaxuan/vue-cmb-router/issues
- npm.io page: https://npm.io/package/vue-cmb-router

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [vue-property-decorator](https://npm.io/package/vue-property-decorator.md) ^8.2.2

## 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

- 0.1.4 (latest) — 2019-10-08
- 0.1.3 — 2019-10-08
- 0.1.1 — 2019-10-08
- 0.1.0 — 2019-10-08

## README

# vue-cmb-router

![images](https://img.shields.io/badge/vue-2.6.10-brightgreen)
![images](https://img.shields.io/badge/vue--cli-3.x-lightgrey)

## 前言

招商银行app中的WebView路由跳转组件，为的是使app中的WebView左上角返回键能在使用`vue-router`情况下正常返回。

## 用法

> 路由一定要使用history模式，否则跳转失效。

main.js
```js
import VueCmbRouter from 'vue-cmb-router';

Vue.use(VueCmbRouter);

/**
 * or
 * 
 * import { CmbLink, cmbPush } from 'vue-cmb-router';
 * 
 * Vue.component(CmbLink.name, CmbLink);
 * Vue.prototype.$cmbPush = cmbPush;
 */
```

component.vue
```vue
<template>
  <div>
    <cmb-link class="cmb-link" to="page/foo" tag="div">jump1</cmb-link>
    <div @click="push('page/bar')">jump2</div>
  </div>
</template>

<script>
export default {
  methods: {
    push(to) {
      this.$cmbPush(to);
    }
  }
}
</script>
```

## 声明文件

```ts
import Vue from 'vue';
declare module 'vue/types/vue' {
  interface Vue {
    $cmbPush: (to: string) => void
  }
}
```

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