Commit 2bfb1a87 authored by Dean Shi's avatar Dean Shi

add menu item route property

parent f1e742ab
......@@ -172,6 +172,7 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| index | 唯一标志 | string | — | — |
| route | Vue Router 路径对象 | Object | — | — |
### Menu-Group Attribute
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
......
......@@ -12,6 +12,10 @@
type: String,
required: true
},
route: {
type: Object,
required: false
},
disabled: {
type: Boolean,
required: false
......@@ -24,7 +28,7 @@
},
methods: {
handleClick() {
this.rootMenu.handleSelect(this.index, this.indexPath);
this.rootMenu.handleSelect(this.index, this.indexPath, this.route);
}
},
created() {
......
......@@ -84,7 +84,7 @@
this.$emit('open', index, indexPath);
}
},
handleSelect(index, indexPath) {
handleSelect(index, indexPath, route) {
this.activeIndex = index;
this.$emit('select', index, indexPath);
......@@ -100,7 +100,7 @@
}
if (this.router) {
this.$router.push(index);
this.$router.push(route || index);
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment