green button when sent
This commit is contained in:
1 parent
e4519f1bc8
commit
d0a18c787e
1 file changed
+13
-1
@@ -47,6 +47,13 @@ export default defineComponent({
|
||||
resetFile() {
|
||||
this.file = null;
|
||||
(document.getElementById('fileUpload') as HTMLInputElement).value = "";
|
||||
},
|
||||
titleSendButton() {
|
||||
if (this.sent === true)
|
||||
return "Envoyé";
|
||||
if (this.file === null)
|
||||
return "Aucune image sélectionnée";
|
||||
return "Envoyer (" + this.file.length + " image(s) sélectionnée(s))";
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -76,7 +83,7 @@ export default defineComponent({
|
||||
<input id="fileUpload" type="file" @change="handleFilesUpload($event as InputFileEvent)" accept="image/jpeg"
|
||||
multiple />
|
||||
</label>
|
||||
<button :class="sent ? 'green' : 'normal'" @click="submitImage()">{{ sent ? 'Envoyé' : 'Envoyer' }}</button>
|
||||
<button :class="sent ? 'green' : 'normal'" @click="submitImage()">{{ titleSendButton() }}</button>
|
||||
<button v-if="file !== null" @click="resetFile()">Reinitialiser</button>
|
||||
</div>
|
||||
<h2 v-if="file !== null">Preview :</h2>
|
||||
@@ -122,4 +129,9 @@ h2 {
|
||||
justify-content: space-evenly;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user