Answer the question
In order to leave comments, you need to log in
How to render nested dropdown menu based on server response?
Good day!
I'm making an online store on nuxt.js and ran into a problem.
In advance, I admit my stupidity and inexperience.
I need a nested drop down menu with product categories. The menu is two-level, the hierarchy can be obtained from the collection in MongoDB. For requests, axios is used.
{ "Название категории": { open: false } }
and try to push it into data()
. @mouseenter
that @mouseleave
call the toggle function.this.dropDowns["Название категории"].open = !this.dropDowns["Название категории"].open
data()
, which is empty at the start, reasonably giving out cannot read property "open" of undefined
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