mirror of https://github.com/ElemeFE/element
add menu item route property
parent
f1e742ab23
commit
2bfb1a870f
|
@ -172,6 +172,7 @@
|
||||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||||
|---------- |-------- |---------- |------------- |-------- |
|
|---------- |-------- |---------- |------------- |-------- |
|
||||||
| index | 唯一标志 | string | — | — |
|
| index | 唯一标志 | string | — | — |
|
||||||
|
| route | Vue Router 路径对象 | Object | — | — |
|
||||||
|
|
||||||
### Menu-Group Attribute
|
### Menu-Group Attribute
|
||||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
route: {
|
||||||
|
type: Object,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false
|
required: false
|
||||||
|
@ -24,7 +28,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick() {
|
handleClick() {
|
||||||
this.rootMenu.handleSelect(this.index, this.indexPath);
|
this.rootMenu.handleSelect(this.index, this.indexPath, this.route);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
this.$emit('open', index, indexPath);
|
this.$emit('open', index, indexPath);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelect(index, indexPath) {
|
handleSelect(index, indexPath, route) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
this.$emit('select', index, indexPath);
|
this.$emit('select', index, indexPath);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.router) {
|
if (this.router) {
|
||||||
this.$router.push(index);
|
this.$router.push(route || index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue