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 /> Â ...