M
M
myskypesla2018-04-28 21:05:03
Vue.js
myskypesla, 2018-04-28 21:05:03

How to avoid Vuex and ESLint error?

There is such a method in the index.vue file:

getRouteName() {
  const routeName = this.$route.name;
  this.$store.dispatch('pageName', routeName);
}

And there is such an action in Vuex:
pagePath({dispatch}, routeName) { // вот здесь возникает ошибка якобы "dispatch is not defined"
  alert(`Это страница ${routeName}`);
}

How to deal with this error in ESLint? Other than // eslint-disable-next-line and // eslint-disable? And apart from the ESLint settings in general?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question