1.0.7 • Published 2 years ago

dynamic-router-view v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

dynamic-router-view

Vue routing dynamic cache scheme

install and use

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

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.1.0

2 years ago

1.0.0

2 years ago