Açıklama Yok

bhuh12 6b3a49faa5 优化"页签规则" Demo 6 yıl önce
dist 6e91dbf0e6 发布 v0.1.4 6 yıl önce
docs e81b700b42 更改 alive-key 为 alive-id,添加"页签规则"文档和Demo 6 yıl önce
public 5c7534f0ba Demo 组件和样式优化 6 yıl önce
src 6b3a49faa5 优化"页签规则" Demo 6 yıl önce
.editorconfig e5688d314a init 6 yıl önce
.gitignore 001c599bce 新增Travis CI构建 6 yıl önce
.npmignore 001c599bce 新增Travis CI构建 6 yıl önce
.travis.yml 001c599bce 新增Travis CI构建 6 yıl önce
LICENSE 38e1856897 新增docs文档,添加logo 6 yıl önce
README.md e81b700b42 更改 alive-key 为 alive-id,添加"页签规则"文档和Demo 6 yıl önce
babel.config.js e5688d314a init 6 yıl önce
package.json 6e91dbf0e6 发布 v0.1.4 6 yıl önce
vue.config.js 001c599bce 新增Travis CI构建 6 yıl önce
yarn.lock f38546eda5 引入vuepress/pwa插件 6 yıl önce

README.md

Vue Router Tab logo

Build Version Downloads License

Vue Router Tab

Vue Router Tab 是基于 Vue Router 的路由页签组件。

主流多页签方案的缺陷

目前主流的 Vue.js 多页签方案(参考文档),是基于 <keep-alive><router-view> 组件实现的,由于通过组件的 name 来控制缓存,该方案存在以下缺陷:

  1. 配置麻烦:需要同时配置 route 和 页面组件的 name 并保持一致,还要确保 name 不重复

  2. 同一个页面组件不能在不同的路由页签独立缓存,不利于组件的复用

  3. 页面缓存难以清理,需要通过各种钩子来更新页面数据

  4. 无法针对路由定制独立的页签规则

Vue Router Tab 方案

针对主流方案的各种问题,Vue Router Tab 定制开发了 <router-alive> 缓存组件来控制路由页面缓存。

功能

文档:

https://bhuh12.github.io/vue-router-tab/

演示:

https://bhuh12.github.io/vue-router-tab/demo/

项目命令

插件打包

npm run lib:build

插件打包并生成报告

npm run lib:build:report

插件发布

npm run lib:publish

文档开发

npm run docs:dev

文档打包

npm run docs:build

Demo 演示开发

npm run demo:dev

Demo 演示打包

npm run demo:build

代码风格检查

npm run lint

代码风格检查并修复

npm run lint:fix