The NavMenu navigation menu of elementUI jumps to other pages and keeps the current selected state

The NavMenu navigation menu of elementUI jumps to other pages and keeps the current selected state

need:

  • For example, to jump to a page, it is already selected
  • Then at this time, select other states in it
  • We also want to keep the same selection

accomplish:
insert image description here
insert image description here

step:

  1. Turn the :default-active call in the el-menu tag into a calling method
    • before:
      insert image description here

    • Now:
      insert image description here

  2. In the method, determine the path of the page if you want to jump
  3. Then return the path we need to display
    insert image description here
  • my data
    insert image description here

Guess you like

Origin blog.csdn.net/weixin_42947972/article/details/128344546
Recommended