No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Ylec
    Y
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Groups 0

    Ylec

    @Ylec

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Ylec Follow

    Latest posts made by Ylec

    • RE: Issue with vuelidate state not updating

      Damn, I feel dumb to not have read the documentation properly, and creating a post not related to Quasar at all…
      Thanks.

      posted in Help
      Y
      Ylec
    • RE: Issue with vuelidate state not updating

      Thanks, it works that way, but in the vuelidate doc, about the $dirty property, it’s written that it is set automatically when writing to $model value.
      In my case, it’s not set automatically.

      posted in Help
      Y
      Ylec
    • Issue with vuelidate state not updating

      Hello, I have issue with vuelidate (0.7.4) integration with last version of Quasar.

      I added vuelidate in boot folder.

      My component :

      <template>
        <q-page class="flex flex-center">
          <div class="q-pa-md" style="max-width: 400px">
      
            <q-card class="q-pa-md">
              <q-form
                @submit="onSubmit"
                class="q-gutter-md"
              >
      
                {{$v.form.username}}
                <p v-if="error" class="q-pa-sm text-white rounded-borders bg-negative">{{ error }}</p>
                <q-input
                  filled
                  v-model.trim.lazy="form.username"
                  :disabled="loading"
                  label="Your login *"
                  hint="Nom d'utilisateur ou adresse e-mail"
                  :error="!this.$v.form.username.$error"
                  error-message="Required"
                >
                  <template v-slot:prepend>
                    <q-icon name="person"/>
                  </template>
                </q-input>
      
      
                <q-input
                  filled
                  type="password"
                  :disabled="loading"
                  v-model.trim="form.password"
                  label="Votre mot de passe *"
                  :error="!this.$v.form.password.$error"
                  error-message="Required"
                >
                  <template v-slot:prepend>
                    <q-icon name="vpn_key"/>
                  </template>
                </q-input>
      
                <div>
                  <q-btn type="submit" color="primary" :disabled="this.loading">
                    <q-spinner v-if="this.loading"></q-spinner>
                    Log in
                  </q-btn>
                </div>
              </q-form>
            </q-card>
      
          </div>
        </q-page>
      </template>
      
      <script>
        import {required} from 'vuelidate/lib/validators'
      
        export default {
          name: 'Login',
          data: function () {
            return {
              form: {
                username: '',
                password: ''
              },
              loading: false,
              error: ''
            }
          },
          validations: {
            form: {
              username: {required},
              password: {required}
            }
          },
      
          methods: {
            async onSubmit() {
             ....
            }
          }
        }
      </script>
      
      <style>
      </style>
      
      

      My issue is that all value from $v state are not update.
      model, $invalid and required are updated, but $error and $dirty are always false.

      Here is $v value when login field is empty :

      { 
      "required": false, 
      "$model": "",
      "$invalid": true, 
      "$dirty": false, 
      "$anyDirty": false, 
      "$error": false, 
      "$anyError": false, 
      "$pending": false, 
      "$params": { "required": { "type": "required" } }
      }
      

      Does anybody knows what is happening here ?
      Thanks.

      posted in Help
      Y
      Ylec