Adding a photo submission UI
To build the app, we will first add our components and the file to store the constants that we will need throughout the app. To start with, we get rid of the components/HelloWorld.vue
file. Then, we remove any references of it in the App.vue
file, including the import
and components
properties to unregister the component. Now we will add some new components to our app.
First, we add the PhotoFormPage.vue
component file to the src/components
folder. Inside the file, we add the following template:
<template> <div class="form"> <h1>{{ $route.params.id ? "Edit" : "Add" }} Photo</h1> <form @submit.prevent="submit"> <div> <label for="name">Name</label> <br /> ...