[Vuejs]-How to update vuejs component data with methods?

0👍

statements should be ended with a semicolon ; not comma ,

export default {
  data() {
    return {
      queryLevel: "",
      queryCycle: "",
      querySubject: ""
    };
  },
  watch: {
    queryLevel() {
        if (this.queryCycle != "" || this.querySubject != "") {
          this.queryReset(); // use `this.queryReset()` 
        }
    }
  },
  methods: {
    queryReset() {
      this.queryCycle = ""; // Should end with semicolon
      this.querySubject = ""; // Should end with semicolon
    }
  }
}

0👍

Don’t understand why you’re using comma at the end instaead of ";"

this.queryCycle = "",
this.querySubject = "",

Leave a comment