How can I concatenate strings in a V-bind validation?

3

I have a validation of Vue.js that makes certain fields mandatory according to the value that has a <el-option> that shows different estados_civiles and I need the fields to be mandatory when the value is different from 'viudo','separado','soltero'

here is my code that only validates bachelor in this case

 v-bind:required="this.form.civil_state !='Soltero' ? true : false"

I also need to show the corresponding message because by default it shows cuple_name_is required , some idea?

This is my property, but you can see that it is not entering there

couple_name:[
        { message: this.$t('error_msg.couple_name_required')},
      ],
    
asked by Jeypi 23.08.2018 в 20:44
source

1 answer

2

Try it like this:

v-bind:required="(this.form.civil_state !='Soltero' 
                    && this.form.civil_state != 'Viudo' 
                      && this.form.civil_state != 'Separado') ? true : false"
    
answered by 23.08.2018 / 20:49
source