Adding a photo display
Here, we add a search page so that we can search for photo entries using their names. To do that, we add the SearchPage.vue
component file to our project's src/components
folder.
The SearchPage.vue
component is simpler than the PhotoForm
component. It has one form element with one form field. The form field is used to accept a keyword from the user to search our photo collection. The input has the type
attribute set to text
, so we have a regular text input in our code. As with the other inputs, we bind the input value to a reactive property with the v-model
directive. The id
parameter is set so that we can use the for
attribute with the label. The form also has a Search button, which has an input
type set to submit
:
<template> Â Â <div> Â Â Â Â <h1>Search</h1> Â Â Â Â <form @submit.prevent="submit"> Â Â Â Â Â Â <div> Â Â Â Â ...