Skip to content

Commit 3e801b6

Browse files
张柯雨张柯雨
authored andcommitted
[feature] add $route.options
1 parent 008d912 commit 3e801b6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/privilegeMenu.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ export default {
117117
methods: {
118118
menuGenerate() {
119119
if(this.router){
120-
this.$router.addRoutes(routesGenerate(this.routerMap, this.role))
120+
let realRoutes = routesGenerate(this.routerMap, this.role)
121+
this.$router.addRoutes(realRoutes)
122+
this.$router.options.routes = this.$router.options.routes ?
123+
this.$router.options.routes.concat(realRoutes) :
124+
realRoutes
121125
}
122126
this.siders = sideMenuGenerate(this.routerMap, this.role)
123127
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-privilege-menu",
33
"description": "Automatically generate routes and menu by given privilege",
4-
"version": "1.0.9",
4+
"version": "1.0.10",
55
"author": "zhangkeyu",
66
"license": "MIT",
77
"private": false,

0 commit comments

Comments
 (0)