<div class="radio-box" th:each="dict : ${@dict.getType('quanxian')}">

                        <label  th:for="${'permissions_' + dict.dictCode}" >
                            <input name="permissions" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
                        </label>
<!--                        放外面 否则会多次添加-->
                        <input th:value="*{permissions}" id="quanxian" type="hidden">//回显用添加页不用   
                    </div>


$("[name='permissions']").each(function(){
            const that=$(this)
            if($("#quanxian").val().indexOf(that.val())!=-1&&that.attr("checked")!=1)
                that.attr("checked",1)
        })
显示页删字段字典
Logo

快速构建 Web 应用程序

更多推荐