更新 announcement.html
parent
20bb7bd1f6
commit
1bb907c71e
|
|
@ -44,45 +44,45 @@
|
|||
</div>
|
||||
<div class="layui-body">
|
||||
<div class="layui-container">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs12">
|
||||
<h1 class="layui-header">公告</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs12">
|
||||
<h1 class="layui-header">公告</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6">
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>今日课程</legend>
|
||||
<div class="layui-field-box">
|
||||
<!-- 这里可以动态列出今日课程 -->
|
||||
<p>1. 数学 - 上午9:00</p>
|
||||
<p>2. 物理 - 下午1:00</p>
|
||||
<p>3. 文学 - 下午3:00</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6">
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>今日课程</legend>
|
||||
<div class="layui-field-box">
|
||||
<!-- 这里可以动态列出今日课程 -->
|
||||
<p>1. 数学 - 上午9:00</p>
|
||||
<p>2. 物理 - 下午1:00</p>
|
||||
<p>3. 文学 - 下午3:00</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
||||
<script src="static/layui.js"></script>
|
||||
<script>
|
||||
// 请求后端获取菜单数据
|
||||
$.get('/api/menu', function (menuItems) {
|
||||
var menuList = $('.layui-nav.layui-nav-tree');
|
||||
menuList.empty();
|
||||
$.get('/api/menu', function (menuItems) {
|
||||
var menuList = $('.layui-nav.layui-nav-tree');
|
||||
menuList.empty();
|
||||
|
||||
menuItems.forEach(function (item) {
|
||||
var href = item.path || 'javascript:void(0);'; // 提供一个默认值
|
||||
menuList.append('<li class="layui-nav-item"><a href="' + href + '">' + item.name + '</a></li>');
|
||||
menuItems.forEach(function (item) {
|
||||
var href = item.path || 'javascript:void(0);'; // 提供一个默认值
|
||||
menuList.append('<li class="layui-nav-item"><a href="' + href + '">' + item.name + '</a></li>');
|
||||
});
|
||||
|
||||
layui.element.render('nav', 'test');
|
||||
});
|
||||
|
||||
layui.element.render('nav', 'test');
|
||||
});
|
||||
|
||||
layui.use(['jquery'], function () {
|
||||
var $ = layui.jquery; // 获取Layui的jQuery对象
|
||||
|
||||
|
|
|
|||
Reference in New Issue