vue element-ui登录页面源码

在这里插入图片描述
HTML

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>登录</title>
		<script src="static/Vue.jsv2.6.12.js" type="text/javascript" charset="utf-8"></script>
		<script src="static/element-ui/lib/index.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="static/element-ui/lib/theme-chalk/index.css" />
	</head>
	<body>



		<el-row type="flex" justify="end" id="bodylogin">
			<div class="login">

				<p class="denglu">登录</p>

				<el-form :label-position="labelPosition" label-width="60px" :model="form">

					<el-form-item label="账号:">
						<el-input v-model="form.username" placeholder="请输入账号"></el-input>
					</el-form-item>

					<el-form-item label="密码:">
						<el-input v-model="form.password" show-password placeholder="请输入密码"></el-input>
					</el-form-item>

					<el-form-item>
						<el-button style="width: 150px;" type="primary" plain @click="onsubmit">登录</el-button>
						<el-button style="width: 150px;" type="primary" plain @click="regist">注册</el-button>
					</el-form-item>

				</el-form>
			</div>
		</el-row>

	</body>
	<script src="js/login.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="./css/login.css" />
</html>

JS

new Vue({
	el: "#bodylogin",
	data: {
		labelPosition: 'center',
		form: {
			username: '',
			password: '',
		}
	},
	methods: {
		/* 登录发送请求 */
		onsubmit() {
			console.log("登录" + this.form.username);
			console.log("密码" + this.form.password);
		},
		regist(){    
			console.log("ddd")
				window.location.href = "/login/regist.html";
		}
	}
});

CSS

.login {
	/* 背景图片 */

	background-image: url(../static/新建文件夹/17.png);
	background-size: 100% 100%;


	/* background-color: powderblue; */

	margin-top: 10rem;
	border-radius: 12px;
	/* 内边距 */
	padding: 20px;
	text-align: center;
	box-shadow: 0 8px 5px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
}

/* 登录文字 */
.denglu {
	color: white;
	font-size: 20px;
}

/* 背景图片 */
body {
	background-image: url(../static/新建文件夹/8.png);
	background-size: 100% 100%;
	background-attachment: fixed;
}
.label-position{
	background-color: #000000;
}

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

需要引入vue js element-ui 如果没有的,可以从我静态资源下载,这里放不下

  • 2
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Silence丶你的名字

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值