直接将参数放到括号里面,th:href跳转需要使用@{},获取后台传来的值使用${}
<a th:href="@{/toEditMemorandum(id=${memorandum?.id?:'-1'})}" target="_blank"></a>
这个需要使用|将参数包括起来
<button th:onclick="|toShow(${bCategoryId})|"></button>
<th:block th:insert="~{modules/website/common/mods-common :: menuPanelChoose('false')}" th:fragment="menu-panel"></th:block> <th:block th:insert="~{modules/website/common/mods-common :: menuPanelChoose('true')}" th:fragment="menu-panel-index"></th:block> <div class="fly-panel fly-column" th:fragment="menuPanelChoose(needSearch)"> <div class="layui-container"> <ul class="layui-clear"> <li class="layui-hide-xs layui-this"><a th:href="@{/}">首页</a></li> </ul> <div class="fly-column-right layui-hide-xs"> <th:block th:if="${needSearch=='true'}"> <input type="text" class="layui-input searchVal" placeholder="请输入搜索的内容" style="display: inline-block;width: auto"> <span class="fly-search" style="margin-left: -50px;"><i class="layui-icon"></i></span> </th:block> <a th:href="@{/blogArticle/addView}" class="layui-btn" target="_blank">发表博客</a> </div> </div> </div>