Home > Software engineering >  ionic input v-model is not working in my code
ionic input v-model is not working in my code

Time:03-27

it's my first time trying Ionic Vue App and in ionic-input the v-model is not working ... any help please?

    data() {
      return {

        model: {
          email: '',
          password: '',
        
        }
   <ion-input alternative
                              
                              name="password"
                              :rules="{required: true, min: 6}"
                              prepend-icon="ni ni-lock-circle-open"
                              type="password"
                              v-model="model.password">
                  </ion-input>

CodePudding user response:

We have the same issue. I've fixed it with :value and @ionInput.

<ion-input alternative
                          
                          name="password"
                          :rules="{required: true, min: 6}"
                          prepend-icon="ni ni-lock-circle-open"
                          type="password"
                          :value="model.password"
                          @ionInput="model.password = $event.target.value;">
              </ion-input>

Found it here: https://github.com/ionic-team/ionic-framework/issues/15532#issuecomment-420031134

  • Related