VUE登錄注冊頁面完整代碼(直接復(fù)制)
效果圖:


Login.vue
<template>
<div class="container">
<div class="login-wrapper">
<div class="header">Login</div>
<div class="form-wrapper">
<input type="text" name="username" placeholder="username" class="input-item">
<input type="password" name="password" placeholder="password" class="input-item">
<div class="btn">Login</div>
</div>
</div>
</div>
</template>
<script>
export default {
name:"Login"
}
</script>
<style scoped>
html {
height: 100%;
}
body {
height: 100%;
}
.container {
/* margin-top: 5%; */
height: 980px;
width: 100%;
background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);
}
.login-wrapper {
background-color: #fff;
width: 358px;
height: 588px;
border-radius: 15px;
padding: 0 50px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.header {
font-size: 38px;
font-weight: bold;
text-align: center;
line-height: 200px;
}
.input-item {
display: block;
width: 100%;
margin-bottom: 20px;
border: 0;
padding: 10px;
border-bottom: 1px solid rgb(128, 125, 125);
font-size: 15px;
outline: none;
}
.input-item:placeholder {
text-transform: uppercase;
}
.btn {
text-align: center;
padding: 10px;
margin: 0 auto;
width: 100%;
margin-top: 40px;
background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
color: #fff;
}
.msg {
text-align: center;
line-height: 88px;
}
a {
text-decoration-line: none;
color: #abc1ee;
}
</style>Register.vue
<template>
<div class="container">
<div class="login-wrapper">
<div class="header">Register</div>
<div class="form-wrapper">
<input type="text" name="username" placeholder="賬戶" class="input-item">
<input type="password" name="password" placeholder="密碼" class="input-item">
<input type="password" name="repassword" placeholder="再次確認(rèn)密碼" class="input-item">
<div class="btn">Register</div>
</div>
</div>
</div>
</template>
<script>
export default {
name:"Reg"
}
</script>
<style scoped>
html {
height: 100%;
}
body {
height: 100%;
}
.container {
/* margin-top: 5%; */
height: 980px;
width: 100%;
background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);
}
.login-wrapper {
background-color: #fff;
width: 358px;
height: 588px;
border-radius: 15px;
padding: 0 50px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.header {
font-size: 38px;
font-weight: bold;
text-align: center;
line-height: 200px;
}
.input-item {
display: block;
width: 100%;
margin-bottom: 20px;
border: 0;
padding: 10px;
border-bottom: 1px solid rgb(128, 125, 125);
font-size: 15px;
outline: none;
}
.input-item:placeholder {
text-transform: uppercase;
}
.btn {
text-align: center;
padding: 10px;
width: 100%;
margin-top: 40px;
background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
color: #fff;
margin: 0 auto;
}
.msg {
text-align: center;
line-height: 88px;
}
a {
text-decoration-line: none;
color: #abc1ee;
}
</style>由于顯示的分辨率和比例不同,最終展示可能出現(xiàn)位置不對等問題,主要調(diào)節(jié)<style>中.container的height屬性和.login-wrapper的transform:屬性
App.vue也奉上:
<template>
<div id="app">
<div class="title">
<div class="btn" @click="msg='Login'">登錄</div>
<div class="btn" @click="msg='Reg'">注冊</div>
</div>
<component :is="msg"></component>
</div>
</template>
<script>
//這里的from路徑根據(jù)自己的布局更改路徑
import Login from './components/login.vue'
import Reg from './components/register.vue'
export default {
name: 'App',
data(){
return{
msg:"Login"
}
},
components: {
Login,
Reg
}
}
</script>
<style>
.title{
text-align: center;
background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);
}
.btn {
background-color: rgb(210,193,326);
border-radius:28px;
border:1px solid #ffffff;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:17px;
padding:16px 31px;
text-decoration:none;
text-shadow:0px 1px 0px #2f6627;
margin: 10px 20px;
}
.btn:hover {
background-color:rgb(180,193,237);
}
.btn:active {
position:relative;
top:1px;
}
</style>總結(jié)
到此這篇關(guān)于VUE登錄注冊頁面的文章就介紹到這了,更多相關(guān)VUE登錄注冊頁面內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- vue?+elementui?項(xiàng)目登錄通過不同賬號切換側(cè)邊欄菜單的顏色
- 登錄頁面的實(shí)現(xiàn)及跳轉(zhuǎn)代碼實(shí)例(vue-router)
- vue前端實(shí)現(xiàn)驗(yàn)證碼登錄功能
- vue實(shí)現(xiàn)登錄數(shù)據(jù)的持久化的使用示例
- Vue實(shí)現(xiàn)驗(yàn)證碼登錄的超詳細(xì)步驟
- 通用vue組件化登錄頁面實(shí)例代碼
- Vue登錄后添加動(dòng)態(tài)路由并跳轉(zhuǎn)的實(shí)踐分享
- vue實(shí)現(xiàn)未登錄訪問其他頁面自動(dòng)跳轉(zhuǎn)登錄頁功能(實(shí)現(xiàn)步驟)
- Vue精美簡潔登錄頁完整代碼實(shí)例
- vue限制實(shí)現(xiàn)不登錄無法進(jìn)入其他頁面
相關(guān)文章
vue input 輸入校驗(yàn)字母數(shù)字組合且長度小于30的實(shí)現(xiàn)代碼
這篇文章主要介紹了vue input 校驗(yàn)字母數(shù)字組合且長度小于30的實(shí)現(xiàn)代碼,文章給大家補(bǔ)充介紹了在Vue.Js下使用el-input框只能輸入數(shù)字并限制位數(shù)并且限制中文輸入以及粘貼功能,感興趣的朋友跟隨腳本之家小編一起看看吧2018-05-05
Vue中使用vue-count-to(數(shù)字滾動(dòng)插件)詳細(xì)教程
這篇文章主要給大家介紹了關(guān)于Vue中使用vue-count-to(數(shù)字滾動(dòng)插件)的相關(guān)資料,最近需要開發(fā)一個(gè)數(shù)字滾動(dòng)效果,在網(wǎng)上找到一個(gè)關(guān)于vue-countTo的插件,覺得這個(gè)插件還不錯(cuò),需要的朋友可以參考下2023-09-09
Vue ElementUI中Upload組件批量上傳的實(shí)現(xiàn)代碼
ElementUI中Upload組件批量上傳通過獲取upload組件的DOM、文件、上傳地址和數(shù)據(jù),封裝uploadFiles方法,使用ajax方式上傳多個(gè)文件,后臺接口接收多文件并返回上傳結(jié)果,本文介紹Vue ElementUI中Upload組件如何批量上傳,感興趣的朋友一起看看吧2025-02-02
vite+vue3項(xiàng)目集成ESLint與prettier的過程詳解
這篇文章主要介紹了vite+vue3項(xiàng)目中集成ESLint與prettier的相關(guān)知識,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-09-09
vue中使用vee-validator完成表單校驗(yàn)方案
vee-validator是一種基于vue模板的輕量級校驗(yàn)框架。本文主要討論的是vee-validator校驗(yàn)方案,感興趣的朋友跟隨小編一起看看吧2019-11-11
vue實(shí)現(xiàn)純前端表格滾動(dòng)分頁加載
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)純前端表格滾動(dòng)分頁加載,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-04-04
vue實(shí)現(xiàn)移動(dòng)端table表格簡單方法
這篇文章主要給大家介紹了關(guān)于vue實(shí)現(xiàn)移動(dòng)端table表格簡單方法的相關(guān)資料,使用Vue.js開發(fā)移動(dòng)應(yīng)用程序時(shí),經(jīng)常需要使用各種UI組件,其中el-table是一個(gè)常用的表格組件,可以方便地展示數(shù)據(jù),需要的朋友可以參考下2023-09-09

