V
V
Vlad ~2021-03-23 21:57:11
Vue.js
Vlad ~, 2021-03-23 21:57:11

What is causing this unknown mutation type: breadcrumbsPush error?

there is a task to throw an array into the storage when loading the page

breadcrumbs:  [
first:"/"
second:"/organisations/335594c5-f847-5069-ac6f-a4aa2c50af9f/contact"
]

in vuex there is state breadcrumbs: []
in mutations I do this mutation
breadcrumbsPush(state, data) {
    state.breadcrumbs.push(data)
  },

and call it in mounted
this.$store.commit('breadcrumbsPush', this.breadcrumbs);

but in the end nothing happens and in the console the error is unknown mutation type: breadcrumbsPush
how can I fix this and what is the error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2021-03-25
@examp1

Moved the comment to the answers
Judging by the above structure, the store should be called like this:

this.$store.commit('app/breadcrumbsPush', this.breadcrumbs);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question