Giter Club home page Giter Club logo

quasar-app-extension-vuelidate-rules's People

Contributors

daemach avatar dgvai avatar error354 avatar oddgoo avatar ramsesmoreno avatar robertolangarica avatar simpson-yfu-org avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

quasar-app-extension-vuelidate-rules's Issues

Quasar plugin

Can I use this with Quasar plugin instead Quasar CLI?

quasar/app-vite compatibility

Hi, after installing this extension I cannot run my app with quasar dev because I get an error:
App • ⚠️ Extension(vuelidate-rules): Dependency not found - @quasar/app. Please install it.
I suppose that it's because i use Quasar with Vite, so in my package.json I have "@quasar/app-vite": "^1.0.0-alpha.0" and no @quasar/app
Could you make it compatible with Vite?

Vue 3 Composition API $rules - Cannot find name (ts2304)

Hello, I'm using Volar + VS Code.

In main.ts file i have import
import quasarRegisterVuelidateRules from 'quasar-app-extension-vuelidate-rules/src/boot/register-vuelidate-rules';
then i registred it globally
quasarRegisterVuelidateRules({ app });

But in component i have an issue in line
:rules="[$rules.requiredIf(hasWatchers, ERROR_MESSAGES.required)]"
VS Code highlited $rules - Cannot find name (ts2304).

Validation work, but how can I disable this error message.

How to reset the validations of a form?

Hi, I like this plugin very much.
However, I can't find out how to reset the entire form (or all inputs with rules), after using it the first time (or after I cancel the form).
All my inputs on the form have as v-model a sub-property of a formdata-object which is a computed, based on a Object-prop in Vue3 Composition API :

const props = defineProps({
  modelValue: {
    type: Object,
    default: () => {},
  },
});

const formdata = computed({
  get: () => props.modelValue,
  set: (newvalue) => {
    emit("update:modelValue", newvalue);
  },
});

the form inputs look like this :

<q-input
    v-model="formdata.name"
    label="Name"
    :rules="[
      $rules.required('Name is required'),
    ]"
/>

In the Vuelidate docs I see something like
this.$v.$reset()
but with your plugin I can't find such an object anywhere.

Hope you can help!

requiredif

Does this library support requiredif? If so, can you please add it to the list of examples, especially syntax?

How to access $rules in a method, instead of in an attribute?

I'm wondering how I could use the $rules variable inside a method ?

I'm trying to make an array of rules, and have a helper function to retrieve the right rule for each field.

const rules_array = [
  {
    fieldname: 'KlantID',
    rules: [
      veld('klant.required') &&
        $rules.required(veld('klant.required_error')),
    ],
  },
  {
    fieldname: 'LokatieID',
    rules: [
      veld('lokatie.required') &&
        $rules.required(veld('lokatie.required_error')),
    ],
  },
];

The helper method looks something like this:


function getRules(fieldname) {
  const rule = rules_array .find((rule) => {
    return rule.fieldname === fieldname;
  });
  if (rule) {
    return rule.rules;
  } else {
    return false;
  }
}

Inside the HTML I want to use this attribute :
:rules="getRules('KlantID')"

This doesn't work because the $rules variable is not known inside the rules_array declaration.

Any idea?

custom regular expression feature

:rules="[$rules.required('Name is required'),$rules.alphaNum('Name should be alpha numeric')]"
By checking above rule field should be required as well as field will only valid for apha and numerics but the issue was when we given the space its throwing error.
how can we full fill that requirement like accepting the value with space/some special characters as well.

how can add my own regex like(regex('alpha', /^[a-zA-Z]*$/)).

Thanks in advance

Typescript / useVuelidateRules()

Love this! So elegant! I have some very complex forms to build with dozens of fields and this will make things much cleaner. Thank you.

Is it possible to have typescript definitions for this? And/or to make it work like a vue component the same way that many on https://vueuse.org/ work?

Apologies for asking: I attempted to do this myself, but my typescript-fu is lacking at the moment (started first major quasar project a few days ago) and I could not create code that would compile and meet all the type constraints of vuelidate itself.

how to load extension in Quasar test

This is not an issue, but a question. How do I load this extension in a component test?

For example, I am using the $rules.minValue) validator, but when my test executes I get a TypeError: Cannot read property 'minValue' of undefined error. I do not understand how to load this extension in the Quasar test. I tried just using the name of the extension as it is named in quasar.extensions.json, but that does not work:

const wrapper = mountQuasar(MyComponent, {
  quasar: { components },
  mount: { localVue, store },
  propsData: { ... },
  plugins: ['vuelidate-rules']
});

I sense that the extension shouldn't be loaded in that plugins section but I can't find any docs on any other way to do it. Any ideas?

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.