Display mobile submenu on click

At the moment, all the menu items get displayed when the hamburger menu is clicked in the mobile view. Would like to know if there is any quick way to display only the main menus, and the sub menus should display once we click on the parent menu items arrow icon.