Implement automatic configuration of page permissions through an array rendering menu.
The n-level menu is composed of n-1 level menus...and so on: the multi-level menu is composed of the second-level menu cycle. Find the NavMenu navigation menu component in element-ui, and use this component to make a loop component for the secondary menu. Menu data is stored in vuex.
Determine whether there is a subset in the component to load different modules. The secondary menu internally loads the first-level component array generated by the loop through the slot, as shown below: list-item component
The index attribute can be replaced by any attribute in the menu object as long as it is unique
Obtain different menu data for different roles from the background, and then use two recursive functions to render the menu and dynamically add menu routing to implement page permission configuration.
/erpang123/router-demo