这个模版引擎还是难用,不过菜是原罪,几个用到的地方,整理一下
<ul class="layui-nav layui-nav-tree" lay-shrink="all" lay-filter="layadmin-system-side-menu"> <li th:each="menu : ${menus}" data-name="home" class="layui-nav-item"> <a href="javascript:;" lay-tips="页面" lay-direction="2"> <i th:attr="class='layui-icon '+${menu.menuIcon}"></i> <cite th:text="${menu.menuName}"></cite> </a> <dl th:each="subMenu : ${menu.subMenu}" class="layui-nav-child"> <dd> <a th:attr="lay-href=${subMenu.menuUrl}" th:text="${subMenu.menuName}"></a></dd> </dl> </li> </ul>
<div class="layui-card"> <div class="layui-card-header" th:text="'发布人:'+${demandVO.createUsername}"></div> <div class="layui-card-body" th:text="'内容:'+${demandVO.content}"> </div> <div class="layui-card-body layui-row" > <img th:each="img: ${demandVO.imgList}" th:attr="src=@{${img.sourcePath}}" style="width: 30%"> </div> </div>
<select name="roleId" id="roleId" lay-verify="required"> <option th:each="role : ${roleList}" th:text="${role.name}" th:value="${role.id}" ></option> </select>