1.为什么使用vue-validator总是报错,
在main.js中这样引入:
import VueValidator from 'vue-validator' Vue.use(VueValidator)
在logoin.vue组件中这样写的:
<validator name="validation"> <form novalidate > <p> <span class="phone"></span> <input name="phone" type="text" id="username" v-model="message.userLoginName" placeholder="请输入账号" v-validate:username="['required']"> <span v-if="$validation.username.required"> 请输入9-20位账号 </span> </p>
慕桂英4014372
相关分类