Answer the question
In order to leave comments, you need to log in
How to dynamically collapse an element in Vue js?
There was a problem. An array of categories and subcategories comes to the component from Vuex, the task is to display all this in the form of a tree.
In the mounted hook of the application itself, I make a request to the server, everything that came in is recorded in the state field. Further, in the component itself, if is a calculated property, in which I receive data from Vuex.
As a result, I display it dynamically through a loop. But I can't get the element to collapse and expand when clicking on the icon. I hung an @click handler on the icon in which I change the open property of this category. The property changes (checked in the console) the elements do not react
Maybe because of this?return this.$store.getters.products;
computed properties are cached based on their dependencies
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question