using thymeleaf之五条件表达式
来源:互联网 发布:想要女生的身体 知乎 编辑:程序博客网 时间:2024/05/16 14:08
5.条件表达式
5.1 ? 'xx' :'xx'(if ? then:else)
e.g.<span th:class="${title} ? 'green' :' red'">样例一</span>
分析:if语句返回null,即为false,走else语句,即返回red;不为null,即为true,返回green.
5.2 ?'xx'(if ? then)
e.g.<span th:class="${title1} ? 'green'">样例二</span>
5.3 设置默认表达式?:
只有if语句值为null时才会设置为默认表达式
e.g.<span th:class="${title2} ?: 'blue'">样例四</span>
0 0
- using thymeleaf之五条件表达式
- 条件表达式-Thymeleaf常见用法(五)
- using thymeleaf之二简单表达式
- thymeleaf条件表达式
- Thymeleaf条件表达式和默认表达式
- using thymeleaf之三文字
- using thymeleaf之十一内联
- <Python进阶读书笔记>之(五) 条件表达式
- Thymeleaf教程 (七) 条件表达式用法
- Thymeleaf教程 (七) 条件表达式用法
- Thymeleaf教程 (五) Thymeleaf标准表达式语法(下)
- Thymeleaf教程 (五) Thymeleaf标准表达式语法(下)
- using thymeleaf之四操作符
- using thymeleaf之九属性优先级
- using thymeleaf之十模板注释
- using thymeleaf之一thymeleaf认识
- using thymeleaf之六th:text/th:utext属性
- using thymeleaf之八th:with定义局部变量
- antlr学习笔记
- Android底层开发之音频输入通道的软硬件分析
- 关于Verilog中的赋值问题
- 日志文件3种状态
- 第四章 4.10节练习
- using thymeleaf之五条件表达式
- 个人项目:统计文本中的单词出现频率
- 点击率校准
- set、env、export的区别
- 关于日期格式为yyyyMMddHHmmss的14位按日、月、年、季度以及去重、未去重查询
- H3C文档NAT专题
- springMVC添加用户demo
- jsp页面杂记
- Sicily1121