首页 > 编程语言 > 详细

Spring switch的使用

时间:2019-06-28 00:55:06      阅读:104      评论:0      收藏:0      [点我收藏+]
 1 <div th:switch="${users}">
 2          <h2 th:case="null">没有数据</h2>
 3          <div th:case="*">
 4             <h2>Users</h2>
 5             <table>
 6                 <thead>
 7                     <tr>
 8                         <th>姓名</th>
 9                         <th>邮箱</th>
10                         <th>修改</th>
11                         <th>删除</th>
12                     </tr>
13                 </thead>

当users等于null时,将把没有数据复制给users

当users等于*时(有数据时),将执行下面4-13行代码

Spring switch的使用

原文:https://www.cnblogs.com/hzyhx/p/11100362.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!