Jade: Change active menu item in parent template

后端 未结 4 833
孤街浪徒
孤街浪徒 2020-12-13 02:56

I have a navigation bar in my parent jade template and I\'d like to highlight the item which is currently in view. So if I\'m on the blog page,

ul
  li Home         


        
4条回答
  •  -上瘾入骨i
    2020-12-13 03:16

    Well, above solution is very clear but if someone is looking more controls over menus then there is a module available for node.js. Use this and you would have complete control over menus.

    Use Case : When menus visibles based on roles

    https://www.npmjs.com/package/active-menu

提交回复
热议问题