Element-ui has its own navigation so that he can only click once.

< el-submenu > < / el-submenu > in the navigation bar, how do I get him to click without showing his children,

Apr.26,2022

judge a requirement that collapse


is difficult to understand. You can try the menu opening event open dynamically set the menu disabled property


you can try the open event to dynamically control the disabled property


<el-submenu index="1" :disabled="disabled">  
    <template slot="title">
      <i class="el-icon-location"></i>
      <span></span>
    </template>
    <el-menu-item-group>...</el-menu-item-group>
    ...
</el-submenu>       
// js
data() {
    return {
      disabled: false    // disabled
  }
},
methods: {
  handleOpen(key, keyPath) {
    console.log(key, keyPath);
    this.disabled = true   // disabled
  },
  handleClose(key, keyPath) {
    console.log(key, keyPath);
  }
}
Menu