前端,HBuilder第七天

本文介绍了使用HBuilder进行前端开发的经验,重点是结合Vue.js和ElementUI搭建用户界面的过程。通过HBuilder的强大编辑功能,提高了开发效率,Vue.js提供了灵活的数据绑定和组件化,而ElementUI作为流行的UI框架,使得界面设计更为简洁高效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="qw">
			<dog title="汪汪汪"></dog>
			<dog title="嗷呜~"></dog>
			<dog title="嗷嗷嗷嗷"></dog>
		</div>
		<script src="vue.js" type="text/javascript"></script>
		<script>
			var tem = Vue.extend({
				props:["title"],
				template:"<button style='border-radius:10px;'>{{title}}</button>",
			})
			Vue.component("dog",tem);
			new Vue({
				el:"#qw",
			})
		</script>
		
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="qw">
			<dog></dog>
		</div>
		<script src="vue.js" type="text/javascript"></script>
		<script>
			var tem = Vue.extend({
				data:function(){
					return{count:1,}
				},
				template:"<button style='border-radius:10px;'>{{count}}</button>",
			})
			Vue.component("dog",tem);
			new Vue({
				el:"#qw",
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="op">
			<cat></cat>
		</div>
		<script src="vue.js"></script>
		<script>
			var tem = Vue.extend({
				data:function(){
					return{count:1};
				},
				template:"<button style='border-radius:10px;' @click='count++'>{{count}}</button>",
			})
			Vue.component("cat",tem);
			new Vue({
				el:"#op"
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<font color="red">字体</font>
		<font color="rgb(0,75,0)">字体</font>
		<font color="#00FF00"></font>
		<hr />
		<button onclick="document.write('天冷了,赶紧出来裸奔!')">嘻嘻</button>
		<button onclick="t1()">嘿嘿嘿</button>
		<script type="text/javascript">
			function t1(){
				document.write("裸奔记得带上面具!")
			}
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="EDG">
			<wuhu></wuhu>
			<wuhu></wuhu>
			<wuhu></wuhu>
			<wuhu></wuhu>
		</div>
		<script src="vue.js"></script>
		<script>
			// var tem = Vue.extend({
			// 	props:["tt"],
			// 	data:function(){
			// 		return{count:1};
			// 	},
			// 	template:"<button style='border-radius: 10px;' @click='test1()'>呵呵{{count}}</button>",
			// 	methods:{
			// 		test1(){
			// 			this.count++;
			// 		}
			// 	}
			// });
			Vue.component("wuhu",Vue.extend({
				props:["tt"],
				data:function(){
					return{count:1};
				},
				template:"<button style='border-radius: 10px;' @click='test1()'>呵呵{{count}}</button>",
				methods:{
					test1(){
						this.count++;
					}
				}
			}));
			new Vue({
				el:"#EDG",
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>图标按钮</title>
		<link rel="stylesheet" type="text/css" href="element-ui/lib/theme-chalk/index.css"/>
	</head>
	<body>
		<div id="EDG">
			<el-row>
				  <i class="el-icon-search"></i>
				  <i class="el-icon-delete"></i>
				  <i class="el-icon-edit"></i>
			</el-row>
		</div>
		<script src="vue.js"></script>
		<script src="element-ui/lib/index.js"></script>
		<script>
			new Vue({
				el:"#EDG",
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="element-ui/lib/theme-chalk/index.css"/>
	</head>
	<body>
		<div id="EDG">
			<el-row>
				  <el-button type="info">信息按钮</el-button>
				  <el-button type="warning">警告按钮</el-button>
				  <el-button type="danger">危险按钮</el-button>
			</el-row>
		</div>
		<script src="vue.js"></script>
		<script src="element-ui/lib/index.js"></script>
		<script>
			new Vue({
				el:"#EDG",
				data:{}
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
		<title>表格组件</title>
		<link rel="stylesheet" href="../vueday03/element-ui/lib/theme-chalk/index.css"/>
		<script src="../vueday03/vue.js"></script>
		<script src="../vueday03/element-ui/lib/index.js"></script>
	</head>
	<body>
		<div id="EDG">
			<template>
			<el-table :data = "users" style="width: 100%;">
				<el-table-column prop="data" label="日期" width="180"></el-table-column>
				<el-table-column prop="name" label="姓名" width="180"></el-table-column>
				<el-table-column prop="address" label="地址"></el-table-column>
				<el-table-column label="操作" width="180">
					<el-button type="warning">编辑</el-button>
					<el-button type="danger">删除</el-button>
				</el-table-column>
			</el-table>
			</template>
		</div>
		<script>
			new Vue({
				el:"#EDG",
				data:{
					users:[{
						data:'2016-05-02',
						name:'王小虎',
						address:'上海市普陀区金沙江路 1518 弄'
					},{
						data:'2016-05-04',
						name:'李逍遥',
						address:'上海市普陀区金沙江路 1517 弄'
					},{
						data:'2016-05-01',
						name:'赵灵儿',
						address:'上海市普陀区金沙江路 1519 弄'
					},{
						data:'2016-05-03',
						name:'林忆如',
						address:'上海市普陀区金沙江路 1516 弄'
					}]
				}
			})
		</script>
	</body>
	
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>容器布局</title>
		<link rel="stylesheet" href="../vueday03/element-ui/lib/theme-chalk/index.css"/>
		<script src="../vueday03/vue.js"></script>
		<script src="../vueday03/element-ui/lib/index.js"></script>
		<style>
			.el-header,.el-footer{
				background-color: #d18e66;
				color: #333;
				text-align: center;
				height: 100px;
			}
			.el-aside{
				background-color: #55e658;
				color: #333;
				text-align: center;
				height: 580px;
			}
			.el-main{
				background-color: #5fb1f3;
				color: #333;
				text-align: center;
				height: 520px;
			}
		</style>
	</head>
	<body>
		<div id="EDG">
			<el-container>
				<el-header>头部区域</el-header>
				<el-container>
					<el-aside width="200px">侧边栏区域</el-aside>
					<el-container>
						<el-main>主区域</el-main>
						<el-footer>底部区域</el-footer>
					</el-container>
				</el-container>
			</el-container>
		</div>
		<script>
			new Vue({
				el:"#EDG",
			})
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>基本布局</title>
		<link rel="stylesheet" href="../vueday03/element-ui/lib/theme-chalk/index.css"/>
		<script src="../vueday03/vue.js"></script>
		<script src="../vueday03/element-ui/lib/index.js"></script>
		<style>
			.el-row{
				margin-bottom: 20px;
			}
			.bg-purple-dark{
				background: red;
			}
			.bg-purple{
				background: #00FFFF;
			}
			.bg-purple-light{
				background: #F0C78A;
			}
			.grid-content{
				border-radius: 4px;
				min-height: 36px;
			}
		</style>
	</head>
	<body>
		<div id="EDG">
			<el-row>
				<el-col :span="24">
					<div class="grid-content bg-purple-dark"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="12">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="8">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="8">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="8">
					<div class="grid-content bg-purple"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="6">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="6">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="4">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="4">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="4">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="4">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="4">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="4">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="2">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple"></div>
				</el-col>
				<el-col :span="1">
					<div class="grid-content bg-purple-light"></div>
				</el-col>
			</el-row>
		</div>
	</body>
	<script>
		new Vue({
			el:"#EDG"
		})
	</script>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值