...
/Building the UI for Product API: Adding a Product
Building the UI for Product API: Adding a Product
Learn how to add a new product on the page.
Delete the “About” page
We won’t be using the “About” page, so let’s delete the About.vue
file and router code.
Press + to interact
{path: "/about",name: "About",// route level code-splitting// this generates a separate chunk (about.[hash].js) for this route// which is lazy-loaded when the route is visited.component: () =>import(/* webpackChunkName: "about" */ "../views/About.vue"),}
Create the template
Let’s create a file called AddProduct.vue
with a container
class. It has two properties, baseURL
and categories
. We’ll have a dropdown to select which category to add the product to.
We’ll have five variables that are ...