Disable Submit Button if comment is less than 3 characters

This commit is contained in:
Matt Rider 2019-04-24 14:58:22 -03:00
parent f6cf05743a
commit 05d393064a

View File

@ -338,11 +338,15 @@ export default {
return this.$store.getters['auth/user'].id === id
},
updateEditorContent(value) {
const content = value.replace(/<(?:.|\n)*?>/gm, '').trim().length
if (content < 3) {
this.disabled = true
} else {
this.disabled = false
}
this.$refs.commentForm.update('content', value)
},
clearEditor() {
this.loading = false
this.disabled = false
this.form.content = ' '
},
addComment(comment) {