Skip to content

chore(docs): simplify <b-form-group> validation message example (closes #5850) #5862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/components/form-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
description="Let us know your name."
label="Enter your name"
label-for="input-1"
valid-feedback="Thank you!"
:invalid-feedback="invalidFeedback"
:valid-feedback="validFeedback"
:state="state"
>
<b-form-input id="input-1" v-model="name" :state="state" trim></b-form-input>
Expand All @@ -25,19 +25,13 @@
export default {
computed: {
state() {
return this.name.length >= 4 ? true : false
return this.name.length >= 4
},
invalidFeedback() {
if (this.name.length > 4) {
return ''
} else if (this.name.length > 0) {
return 'Enter at least 4 characters'
} else {
return 'Please enter something'
if (this.name.length > 0) {
return 'Enter at least 4 characters.'
}
},
validFeedback() {
return this.state === true ? 'Thank you' : ''
return 'Please enter something.'
}
},
data() {
Expand Down