Using a v-if
statement to display certain HTML only if the archiveNote
variable is not empty or null.
<div v-if="archiveNote === null || archiveNote ===''" class="form-check ml-3" id="include-note-div">
Here is how it's implemented
export default {
name: "ConfirmReleaseFilesModal",
props: {
archiveName: String,
archiveNote: String
},
This information is then passed from another Vue file
<confirm-release-files-modal
v-if="showConfirmReleaseFilesModal"
@cancel="closeModal"
@confirmAndEmail="releaseAction"
@confirmNoEmail="releaseAction"
:archive-name="archiveName"
:archive-note ="archiveNote"
>
</confirm-release-files-modal>
The HTML content still appears even when the archiveNote
variable is logged as empty