Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvjiaxuan/vue-cmb-router
招商银行app中的WebView路由跳转组件
https://github.com/lvjiaxuan/vue-cmb-router
Last synced: about 1 month ago
JSON representation
招商银行app中的WebView路由跳转组件
- Host: GitHub
- URL: https://github.com/lvjiaxuan/vue-cmb-router
- Owner: lvjiaxuan
- License: mit
- Created: 2019-10-08T09:48:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T10:30:01.000Z (almost 2 years ago)
- Last Synced: 2024-11-11T10:57:20.357Z (about 2 months ago)
- Language: TypeScript
- Size: 1.49 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
jump1
jump2
export default {
methods: {
push(to) {
this.$cmbPush(to);
}
}
}```
## 声明文件
```ts
import Vue from 'vue';
declare module 'vue/types/vue' {
interface Vue {
$cmbPush: (to: string) => void
}
}
```