Recently I was working on a backend management system, and I needed the menu navigation bar on the left to remain expanded. I used vue+elementUI.
1. Use default-openeds to expand all navigation data obtained from the background.
2. Modify the source code of the menu and comment out the close and open function of clicking the first-level directory.
First, you need to download the source code of elementUi locally.
I downloaded the compressed package directly, ran the npm install command locally, and then tested it by running npm run dist.
Find the source code folder element-dev/element_ui/packages/menu/src/menu.vue in the folder
turn up
Annotate
Then re-run npm run dist
The most important thing is to replace the lib file in element_ui with the node_modules/element-ui lib in the vue project.
Rerun the project, and the left navigation menu will remain expanded.