【问题标题】:Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'super') VuelidateUncaught (in promise) TypeError: Cannot read properties of undefined (reading \'super\') Vuelidate
【发布时间】:2022-10-13 21:13:57
【问题描述】:

第一次使用vuelidate,所以我不知道我可能做错了什么,我一直收到错误,我不确定它是否与语法或什么有关

import { useVuelidate } from "@vuelidate/core";
import { required, email } from "vuelidate/lib/validators";

export default {
  setup() {
    return { v$: useVuelidate() };
  },

  data: () => ({
    userData: {
      firstName: "",
      lastName: "",
      phone: "",
      email: "",
      password: "",
      confirmPassword: "",
    },
    submitted: false,
  }),
  validations() {
    return {
      firstName: { required }, 
      lastName: { required },
      contact: {
        email: { required, email }, 
      },
    };
  },
};

【问题讨论】:

    标签: vue.js vuejs3 super vuelidate html5-formvalidation


    【解决方案1】:

    通过卸载并重新安装 vuelidate 修复

    【讨论】:

      猜你喜欢
      • 2022-01-11
      • 1970-01-01
      • 2022-10-09
      • 2022-07-21
      • 2022-07-22
      • 2022-01-07
      • 2022-10-18
      • 2021-11-10
      • 2022-06-13
      相关资源
      最近更新 更多