Current location - Recipe Complete Network - Complete cookbook of home-style dishes - Vue3+ts background dynamic routing menu rendering
Vue3+ts background dynamic routing menu rendering
1, create the corresponding page for the menu.

2. Create a route corresponding to the page.

A plug-in code is used here.

Use this command to quickly build the above page.

3. Create a map menu. ts file.

Then, you can get the routing table by using the mapMenusToRoutes function exported from the map-menus.ts file where you want to get the routing table. My home page is called Mian.

Reference:

Then the menu component:

The data return is like this:

It finally looks like this: