2

In a Vue.js Project, I am not able to access a property => this.ws_files from a function inside methods. The property is accessible in mounted(), but not in methods.

Below is snippet of the code:

export default {   
  name: 'file-list',

  data () {
    return {
      title: pageName,
      ws_files: "AB"
    }
  },

  mounted () {
    this.getFolderInfo('ZEST/ZEST Negoce/',10)
  },

  methods: {
    getFolderInfo: (folderName,maxKeys) => {
      this.ws_files = "Sant"
    }
  }
}

1 Answer 1

4

Your issue is the same as this question.

You should not define the method using () => {} syntax.

Do this instead:

getFolderInfo(folderName, maxKeys) {
  this.ws_files = "Sant"
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.