I have a mega menu design with the following data structure
const megaMenuLink = [
{
name: 'E-services',
link: '/e-services',
hasSubmenu: true,
subMenuItems: [
{
name: "Access E-services",
link: "/access",
},
{
name: "Register",
link: "/register"
}
]
},
{
name: "Other services",
link: "/services",
hasSubmenu: false,
}
]
I have accessed the name property with {#each} block
{#each megaMenuLink as link}
<li>{link.name}</li>
{/each}
How do I loop through the inner subMenuItems based on condition of 'hasSubmenu' is true?