这是我的mixin:
mixin treeview(...routes)
each route in routes
//- path is a variable which I passed from express
if (path === route)
li.treeview.active
if block
block
//- stop right here
在Javascript中似乎是break
答案 0 :(得分:1)
您可以使用 - 中断
mixin treeview(...routes)
each route in routes
//- path is a variable which I passed from express
if (path === route)
li.treeview.active
if block
block
- break
//- stop right here
一个简单的demo