jos*_*son 1 node.js express pug
我正在使用带有nodejs和表达的Jade.当我在我的玉代码上调用res.render时,它会将其转换为html.但是,html没有换行符.我可以告诉jade保留代码格式吗?
表达2.x
app.set('view options', { pretty: true });
Run Code Online (Sandbox Code Playgroud)
表达3.x
app.locals.pretty = true;
Run Code Online (Sandbox Code Playgroud)
在此Wiki页面中向下滚动到"查看选项" .
另见这个答案.
| 归档时间: |
|
| 查看次数: |
296 次 |
| 最近记录: |