Jade之Case
2015-11-22 17:00
204 查看
Case
jade中的case类似js中的
switch语句。
当前一个
when中无语句的时候,将一直往下直至遇到一个有语句的
when才跳出。
jade:
- var friends = 10 case friends when -1 //- 执行when 1中的语句 when 0 p you have no friends when 1 p you have a friend default p you have #{friends} friends
html:
<p>you have 10 friends</p>
case还有另外一种写法。注意
:后需接一个空格,后面内容若换行会报错。
jade:
- var friends = 1 case friends when 0: p you have no friends when 1: p you have a friend default: p you have #{friends} friends
html:
<p>you have a friend</p>
相关文章推荐
- 【XFeng安卓开发笔记】四大基本组件——跨应用启动service
- php执行系统命令
- 控制反转IOC(依赖注入DI),注入类型,自动装配相关注解
- 学习算法,编程之路
- 编写一个将输入复制到输出的程序 ,并将其中连续的多个空格用一个空格代替 //学习笔记 编写一个将输入复制到输出的程序 ,并将其中连续的多个空格用一个空格代替 运行环境vs2015 #includ
- maven学习2——pom.xml
- 大数相加(顺序表中)
- Linux系统启动流程
- 信息安全系统设计基础第十一周学习总结
- 简单解决Python文件中文编码问题
- 65. 雇员管理系统(2)
- 序言
- Jade之条件语句
- Jade之注释
- 钢条切割问题
- Java读取文件MD5的两种方案
- 树形dp之删边
- Jade之Code
- 信息安全系统设计基础实验一—20135222胡御风20135215黄伟业
- P问题、NP问题、NPC问题以及NP-hard问题理解与区分