GithubHelp home page GithubHelp logo

Comments (2)

VividLemon avatar VividLemon commented on June 11, 2024 1
const count = ref(0);

const newRules = {
  value: {
    maxLength: maxLength(5)
  }
}

const newerV$ = useVuelidate(newRules, count);

Should be changed to

const count = ref(0);

const newRules = {
  count: {
    maxLength: maxLength(5)
  }
}

const newerV$ = useVuelidate(newRules, { count });

The usage is actually noted at https://vuelidate-next.netlify.app/advanced_usage.html#using-an-object-of-refs , although, I am not a particular fan of writing it like this.

In my personal option, the parameter positions of rules/values is backwards. If it was created to be values/rules , then you could define your values object (or lets say also allowing a direct ref, rather than being forced into always needing an object), then you could define your rules with intellisense. I find myself often times working backwards when using the current api. Although, this doesn't really pertain to this issue

from vuelidate.

CaseyHofland avatar CaseyHofland commented on June 11, 2024

Thanks, I understand now.

You raise a good point with intellisense though. Vuelidate is great once it works, but I’ve already lost hours of time due to the intellisense issue alone. When it doesn’t work, I’m frantically trying to change everything until I realize oep, someone changed a type somewhere but everything still build correctly and nobody realized they needed to change the vuelidate schema. It’s incredibly frustrating.

If intellisense will not work with vuelidate, I would at least want it to throw an error so I can debug in the console. Right now it’s not giving me anything. It would have likely helped me out with this problem, too.

from vuelidate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.