快速切换vue-router的历史记录,采用LRU + Indexdb存储方案
npm install @beige/quick-vue-history --save
import router from '@/you-vue-router' // 你的vue-router配置
import { createQuickHistory } from '@beige/quick-vue-history'
import '@beige/quick-vue-history/dist/quick-vue-history.css'
createQuickHistory(router, options)
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
storeName | String | 'QUICK_VUE_HISTORY' | 存储的键名 |
exclude | Array | [] | 需要过滤的路由path列表,如:['/login'] |
maxLength | Number | 10 | 历史缓存最大长度, 0表示无限制 |
compressLimit | Number | 3.5 | 压缩图片文件大于此值时压缩 |
compressRate | Number | 0.7 | 压缩率 |
Mac 通过快捷键
Command + k
显示历史记录
windows 通过快捷键
win + k
显示历史记录