简体   繁体   中英

How to change the default message of the required field in the popover of form-control in bootstrap-vue?

I tried to disable or edit the invalid Pop over messages using a traditional Bootstrap method. But it doesn't work like that.

<b-form-input class="form-control" type="email"  required="" placeholder="username"
 oninvalid="this.setCustomValidity('Please Enter valid email')"
 oninput="setCustomValidity('')"></b-form-input>

But answer as follows.

To disable popover messages

<b-form-input id="email" v-model="form.email" type="email" :state="null" 
         placeholder="Enter email"></b-form-input>

To add custom messages, you should change a property :state as true or false and add label to make sure what is error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM