mirror of https://github.com/ElemeFE/element
add menu item route property
parent
f1e742ab23
commit
2bfb1a870f
|
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue