easyUI的基本知识

今天我们来了解一下easyui,并且利用easyui写一个首页

网页地址

http://www.jeasyui.net/(中文网)

http://www.jeasyui.com/(英文版)

EasyUI官方下载地址:http://www.jeasyui.com/download/index.php

常见UI:

Layui,Bootstrap,element ui,ant design,iview

1.什么是easyui?

easyui是一种基于jQuery的用户界面插件集合

2.easyui能带给我们什么好处?

1)easyui是个完美支持HTML5网页的完整框架

2)easyui节省网页开发的时间和规模

3)easyui很简单但功能强大

3.easyui如何使用?

3.1 引入必要的js和css样式文件

1)引入JQuery(jquery.min.js)

2)引入EasyUI(jquery.easyui.min.js)

3)引入EasyUI的中文国际化js,让EasyUI支持中文(locale/easyui-lang-zh_CN.js)

4)引入EasyUI的样式文件(/themes/default/easyui.css)

5)引入EasyUI的图标样式文件(/themes/icon.css)

3.2 路径问题

  3.2.1 相对路径/绝对路径

  3.2.2 base标签

3.3 页面缓存

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">  

4.组件

分类:Base(基础)、Layout(布局)、Menu and Button(菜单和按钮)、Form(表单)、Window(窗口)、

DataGrid and Tree(表格和树)、Extension(扩展)

5.利用easyUI写一个首页

效果图:

左边菜单可以收缩

点击菜单 在输出台输出

  

 代码如下:

首页:

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>

<script src="easyui/jquery.min.js"></script>
<script src="easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="easyui/themes/default/easyui.css">

</head>
<body class="easyui-layout">

	<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:'菜单'" style="width: 20%;">
		<ul id="asideMenu"></ul>
	</div>
	<div data-options="region:'center',title:'内容',collapsible:false" style="padding: 5px; background: #eee;"></div>

	<script>
		$('#asideMenu').tree({//构建方法
			url : 'tree_data.json',//远程数据的地址
			method : "post",//访问方式
			lines : true,//显示虚线
			onClick(node){//点击出现内容
				//取到节点的自定义属性 判断自定义属性中的pid
				if(node.attributes.pid){
					console.log("我是小菜单")
				}else{
					console.log("我是大菜单")
				}
			}
		});
	</script>

</body>
</html>

菜单栏:

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

好咯,今天到这里就结束咯,下次见宝们。

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值