onSubmit=“return validate(this)”
解释一下这段代码:export default defineComponent({ setup() { const formRef = ref() const $router = useRouter() const { userStore } = useStore() const formState: UnwrapRef<FormState> = reactive({ username: '', password: '', ValidCode:'' }) const rules = { username: [{ required: true, message: '请输入账号', trigger: 'blur' }], password: [{ required: true, message: '请输入密码', trigger: 'blur' }], ValidCode:[{ required: true, message: '请输入验证码', trigger: 'blur' }] } const layout = { labelCol: { span: 0 }, wrapperCol: { span: 24 } } const resetForm = () => { formRef.value.resetFields() } const onSubmit = () => { formRef.value.validate().then(() => { userStore.handleLogin(toRaw(formState)).then((res: any) => { if (res.code !== '0000') { message.error(res.msg) return } $router.replace({ path: '/' }) }) }) } return { formRef, formState, rules, layout, logo, resetForm, onSubmit, svg: import('@/assets/svg/login-bg.svg') } }, mounted() { // this.$testFn('hahah'); } })最新发布
相关知识
满满干货!一文快速实现CNN(卷积神经网络)识别花朵
在 Windows 应用中部署 PyTorch 数据分析模型
使用Google reCAPTCHA防止机器注册
深度学习实战——木薯叶图像识别与分类项目
基于VGG网络的花分类
基于spring boot的假花加工和运输管理系统的设计与实现怎么实现加工
度学习pytorch实战六:ResNet50网络图像分类篇自建花数据集图像分类(5类)超详细代码
python 花卉识别系统 用python搭建一个花卉识别系统(IT技术)
基于ResNet34的花朵分类
【pytorch】resNet152迁移学习实现植物病害图像识别分类
网址: onSubmit=“return validate(this)” https://m.huajiangbk.com/newsview764148.html