1 new a Vue instance with data {
sn:'123',
name:'333',
cellPhone:'5554545'
}
2 add validation to input element
<input type="text" class="form-control" id="cellPhone"
name="cellPhone" v-model="cellPhone" v-validate:cellPhone="{ required: true}"
placeholder="请输入手机号"/>
Required your cellPhone.
What is Expected?
the validatior should work correctly
What is actually happening?
the validatior dons't work.
workround:
change validate:cellPhone="{ required: true}"
to
validate:cellphone="{ required: true}"
vue & vue-validator version
Vue.js v1.0.26, vue-validator v2.1.5
Reproduction Link
Steps to reproduce
1 new a Vue instance with data { sn:'123', name:'333', cellPhone:'5554545' } 2 add validation to input element <input type="text" class="form-control" id="cellPhone" name="cellPhone" v-model="cellPhone" v-validate:cellPhone="{ required: true}" placeholder="请输入手机号"/>
Required your cellPhone.
What is Expected?
the validatior should work correctly
What is actually happening?
the validatior dons't work.
workround: change validate:cellPhone="{ required: true}"
to validate:cellphone="{ required: true}"
it works correctly.