Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add default value without triggering @input event? #659

Closed
CraciunVladVirgil opened this issue Sep 24, 2018 · 0 comments · Fixed by #711
Closed

How to add default value without triggering @input event? #659

CraciunVladVirgil opened this issue Sep 24, 2018 · 0 comments · Fixed by #711

Comments

@CraciunVladVirgil
Copy link

CraciunVladVirgil commented Sep 24, 2018

I want to implement a route change prevention if the changes are made to any values in my form. The problem that i have with v-select is that i don't seem to find a way to check if changes are made correctly.

<v-select
        :options="categoryOptions"
        v-model="categoryValue">
</v-select> 

When the selected value is populated from the vuex state an @input event is emitted and then set is called and so my isDirty value is changed to true.

computed: {
 categoryValue: {
        get () {
          return this.$store.getters[...]
        },
        set (value) {
          this.isDirty = true
          this.$store.commit(..., value)
        }
      },
},

Is there a way to set a default value for vue-select that does not trigger the @input event or any other way to implement this?

@CraciunVladVirgil CraciunVladVirgil changed the title How can i implement check if default value is changed? How to add default value without triggering @input event? Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant