We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<template> <view class="container"> <uni-forms ref="valiForm" :modelValue="formData" label-position="top" :rules="rules"> <uni-forms-item label="Email" name="email"> <uni-easyinput type="text" v-model="formData.email" placeholder="Enter Your Email" /> </uni-forms-item> </uni-forms> <button @click="onSubmit">Submit</button> </view> </template> <script setup> import { ref } from 'vue' const valiForm = ref() const formData = ref({}) const rules = ref({ email: { rules: [ { required: true, errorMessage: 'Enter your email', }, { format: 'email', errorMessage: 'Enter a right email', }, { minLength: 1, maxLength: 10, errorMessage: 'Email should be less than 10 characters.' } ] } }) const onSubmit = () => { valiForm.value.validate().then(res=>{ console.log('表单数据信息:', res); }).catch(err =>{ console.log('表单错误信息:', err); }) } </script> <style> </style>
以上代码,只有required工作正常。如果输入不是email,错误提示还说提示required的错误提示,minLength和maxLength规则完全不起作用
The text was updated successfully, but these errors were encountered:
No branches or pull requests
以上代码,只有required工作正常。如果输入不是email,错误提示还说提示required的错误提示,minLength和maxLength规则完全不起作用
The text was updated successfully, but these errors were encountered: