Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

求解Jade 如何获取koa2 中的变量,ctx.state 对应 express 里的 res.locals

$
0
0
//app.js
res.locals.success = 'xxxxxxxx'
//jade 
        -if(locals.success)
            div#alt_sucess.alert.alert-success !{locals.success}

        -if(locals.error)
            div#alt_warning.alert.alert-warning error

Viewing all articles
Browse latest Browse all 14821

Trending Articles