Web开发之使用【easyui】快速搭建管理员主界面

4 篇文章 0 订阅

大家好呀,我是【小阿飞_】😜

今天来给大家分享如何使用easyui这个前端框架快速搭建管理员主界面

先介简单绍一下easyui

又叫Jquery EasyUI,是基于Jquery的界面框架插件,提供了丰富的界面功能,方便快速开发Web界面程序

 easyui的主要结构:

 

 

目前easyui的官方网站已经下架,但是大家想使用easyui的话可以去搜官方文档之类的关键字

比如本期文章所使用的框架就是在【jQuery EasyUI 1.5API 中文版】中找到的👇

easyui和前两期文章中的bootstrap,以及Ant Design、Vue都是比较常用的前端UI(界面)

管理员界面以简洁、方便操作为主,刚好easyui中提供了一个Layout布局很适合用来快速搭建管理员主界面(代码和使用方法都可以在【jQuery EasyUI 1.5API 中文版】中找到)👇👇

在编写之前要将easyui的文件复制到项目中:

 最终实现代码:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- min:压缩版,导入js,css $代表jquery -->
  <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.easyui.min.js"></script>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/icon.css">
</head>
<body class="easyui-layout">
<!--regin位置-->
<div data-options="region:'north',title:'网站信息',collapsible:false" style="height:100px;"></div>
<div data-options="region:'south',title:'赞助链接',collapsible:false" style="height:100px;"></div>
<div data-options="region:'west',title:'菜单',split:true" style="width:20%;">
    <ul id="sidebarTree"></ul>
</div>
<div data-options="region:'center',title:'主体部分'" style="padding:5px;background:#eee;"></div>
<script>
    $("#sidebarTree").tree({
        url: "${pageContext.request.contextPath}/sidebarTree.js",
        lines: true
    })
</script>
</body>
</html>

 js代码

[
  {
    "id": 1,
    "text": "商品管理",
    "attributes": {
      "pid": 0
    },
    "children": [
      {
        "id": 2,
        "text": "商品管理01",
        "attributes": {
          "pid": 1
        }
      },
      {
        "id": 3,
        "text": "商品管理02",
        "attributes": {
          "pid": 1
        }
      }
    ]
  },
  {
    "id": 10,
    "text": "类别管理",
    "attributes": {
      "pid": 0
    },
    "children": [
      {
        "id": 11,
        "text": "类别管理01",
        "attributes": {
          "pid": 10
        }
      },
      {
        "id": 12,
        "text": "类别管理02",
        "attributes": {
          "pid": 10
        }
      }
    ]
  }
]

最终效果:

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值