# dynamic-router-view

> Vue routing dynamic cache scheme

Latest version **1.0.7** (published 2022-08-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install dynamic-router-view
pnpm add dynamic-router-view
yarn add dynamic-router-view
bun add dynamic-router-view
```

## 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.7 |
| Published | 2022-08-10 |
| First published | 2022-08-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jeremy Pu |
| Maintainers | puchunjie |

## Links

- npm: https://www.npmjs.com/package/dynamic-router-view
- npm.io page: https://npm.io/package/dynamic-router-view

## Recent versions

- 1.0.7 (latest) — 2022-08-10
- 1.0.6 — 2022-08-10
- 1.0.5 — 2022-08-10
- 1.0.4 — 2022-08-10
- 1.0.3 — 2022-08-10
- 1.0.2 — 2022-08-10
- 1.0.1 — 2022-08-10
- 0.1.0 — 2022-08-10
- 1.0.0 — 2022-08-10

## README

# dynamic-router-view

> Vue routing dynamic cache scheme

## install and use

``` bash
# install dependencies
npm install dynamic-router-view
or
yarn add dynamic-router-view

# 在 main.js 入口文件中
import Vue from 'vue';
import dynamicRouterView from 'dynamic-router-view'
import store from './store';
import router from './router';


# 注册插件
Vue.use(dynamicRouterView, {
    router,  // 挂载到root的router实例
    store,   // 挂载到root的store实例
    // 缓存路由关系配置
    cacheMap: { 
        listRouterName: ['targetRouterName'] // key: 需要缓存的路由name 如：列表页， value: 跳转目标路由name 如：详情页
    }
})

### 重要提示！
### 重要提示！
### 重要提示！
### 使用次插件，页面组件必须配置name,路由也必须配置name， 并且两个name必须保持一直，严格区分大小写！！

# 原生router-view 替换
<router-view/> 
替换成
<cache-router-view/>

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