Create a category table on the category List page

inadmin->src->views/CategoriesList.vueAdd an action button to the table:

Click on theThe editorAfter the button, jump to the corresponding path:

Configure the routing relationship between paths:

Modify the page component of the new category so that editing and creating share one page component:

Note:At this time, there is a problem: when you click on the edit jump page and click on the left side of the new category menu, although the path side is not refreshed, because of the default component reuse, the page will still display “Edit category”, solution:

When You click Edit Category, the category information is displayed on the page

Write server interface – Gets this category information when Edit category

The background management interface requests the server interface

Click the button to submit data request after editing classification on background management interface

Write the server side edit the classification submission interface

serve->router->admin->index.js

Note: the server interface and the backend management request interface must correspond.

Edit the category in the browser and submit it, and everything works fine.