if message empty else disabled button

This commit is contained in:
ogerly 2022-09-09 14:40:15 +02:00
parent 8f151b3554
commit 6c39fe9362
2 changed files with 22 additions and 2 deletions

View File

@ -14,7 +14,9 @@
<b-button type="reset" variant="danger">{{ $t('form.cancel') }}</b-button>
</b-col>
<b-col class="text-right">
<b-button type="submit" variant="primary">{{ $t('form.submit') }}</b-button>
<b-button type="submit" variant="primary" :disabled="disabled">
{{ $t('form.submit') }}
</b-button>
</b-col>
</b-row>
</b-form>
@ -63,5 +65,13 @@ export default {
this.form.text = ''
},
},
computed: {
disabled() {
if (this.form.text !== '') {
return false
}
return true
},
},
}
</script>

View File

@ -14,7 +14,9 @@
<b-button type="reset" variant="danger">{{ $t('form.cancel') }}</b-button>
</b-col>
<b-col class="text-right">
<b-button type="submit" variant="primary">{{ $t('form.reply') }}</b-button>
<b-button type="submit" variant="primary" :disabled="disabled">
{{ $t('form.reply') }}
</b-button>
</b-col>
</b-row>
</b-form>
@ -63,5 +65,13 @@ export default {
this.form.text = ''
},
},
computed: {
disabled() {
if (this.form.text !== '') {
return false
}
return true
},
},
}
</script>