Vuejs 中的 Vuelidate 名称?
Vuelidate name in Vuejs?
fullname: '',
max: 30,
fullname: { required, minLength: minLength(30), maxLength: maxLength(29) },
computed: {
isDisabled: function(){
return !this.terms || (this.fullname.length < this.max) || (this.mobile.length < this.maxmobile)
|| (this.gstin.length < this.maxgstin) || (this.email.length < this.maxemail);
},
<input
type="text"
id='fullname' v-model='fullname'
v-model.trim="$v.fullname.$model"
:class="{ 'is-invalid': validationStatus($v.fullname) }"
class="input-section"
:maxlength="max"
v-on:keypress="isLetter($event)"
placeholder="Enter your name"
/>
<button class="register-button":disabled='isDisabled'
v-on:click=" isFirstScreen">PROCEED</button>
如果我保持 maxfullname=10 的条件,则在输入 10 个字符后,只有按钮启用。但我需要全名的最大长度应为 30 个字符,即使用户输入少于 30 个字符(10、5、6 等),也必须启用按钮。
fullname: { required, maxLength: maxLength(29) },
computed: {
isDisabled: function() {
return !this.terms || (this.fullname < this.max) || (this.mobile.length < this.maxmobile)
|| (this.gstin.length < this.maxgstin) || (this.email.length < this.maxemail);
},
fullname: '',
max: 30,
fullname: { required, minLength: minLength(30), maxLength: maxLength(29) },
computed: {
isDisabled: function(){
return !this.terms || (this.fullname.length < this.max) || (this.mobile.length < this.maxmobile)
|| (this.gstin.length < this.maxgstin) || (this.email.length < this.maxemail);
},
<input
type="text"
id='fullname' v-model='fullname'
v-model.trim="$v.fullname.$model"
:class="{ 'is-invalid': validationStatus($v.fullname) }"
class="input-section"
:maxlength="max"
v-on:keypress="isLetter($event)"
placeholder="Enter your name"
/>
<button class="register-button":disabled='isDisabled'
v-on:click=" isFirstScreen">PROCEED</button>
如果我保持 maxfullname=10 的条件,则在输入 10 个字符后,只有按钮启用。但我需要全名的最大长度应为 30 个字符,即使用户输入少于 30 个字符(10、5、6 等),也必须启用按钮。
fullname: { required, maxLength: maxLength(29) },
computed: {
isDisabled: function() {
return !this.terms || (this.fullname < this.max) || (this.mobile.length < this.maxmobile)
|| (this.gstin.length < this.maxgstin) || (this.email.length < this.maxemail);
},