VUE登錄注冊(cè)頁(yè)面完整代碼(直接復(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)位置不對(duì)等問(wè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'">注冊(cè)</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登錄注冊(cè)頁(yè)面的文章就介紹到這了,更多相關(guān)VUE登錄注冊(cè)頁(yè)面內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- vue?+elementui?項(xiàng)目登錄通過(guò)不同賬號(hào)切換側(cè)邊欄菜單的顏色
- 登錄頁(yè)面的實(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組件化登錄頁(yè)面實(shí)例代碼
- Vue登錄后添加動(dòng)態(tài)路由并跳轉(zhuǎn)的實(shí)踐分享
- vue實(shí)現(xiàn)未登錄訪問(wèn)其他頁(yè)面自動(dòng)跳轉(zhuǎn)登錄頁(yè)功能(實(shí)現(xiàn)步驟)
- Vue精美簡(jiǎn)潔登錄頁(yè)完整代碼實(shí)例
- vue限制實(shí)現(xiàn)不登錄無(wú)法進(jìn)入其他頁(yè)面
相關(guān)文章
vxe-table?實(shí)現(xiàn)表格數(shù)據(jù)分組功能(按指定字段數(shù)據(jù)分組)
文章介紹了如何使用樹(shù)結(jié)構(gòu)實(shí)現(xiàn)表格數(shù)據(jù)分組,并提供了官方文檔的鏈接,本文結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧2024-11-11
elementUI select組件默認(rèn)選中效果實(shí)現(xiàn)的方法
這篇文章主要介紹了elementUI select組件默認(rèn)選中效果實(shí)現(xiàn)的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-03-03
解決antd Form 表單校驗(yàn)方法無(wú)響應(yīng)的問(wèn)題
這篇文章主要介紹了解決antd Form 表單校驗(yàn)方法無(wú)響應(yīng)的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-10-10
解決vue單頁(yè)面應(yīng)用中動(dòng)態(tài)修改title問(wèn)題
這篇文章主要介紹了解決vue單頁(yè)面應(yīng)用中動(dòng)態(tài)修改title問(wèn)題,本文通過(guò)示例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-06-06
vue3+vite+JS使用Echarts封裝一個(gè)餅圖完整代碼(父子組件聯(lián)動(dòng))
在Vue中繪制餅圖有多種方式,其中最常用的是使用第三方圖表庫(kù),如ECharts、Chart.js等,下面這篇文章主要介紹了vue3+vite+JS使用Echarts封裝一個(gè)餅圖(父子組件聯(lián)動(dòng))的相關(guān)資料,需要的朋友可以參考下2026-03-03
vue實(shí)現(xiàn)自定義日期組件功能的實(shí)例代碼
這篇文章主要介紹了vue自定義日期組件的實(shí)現(xiàn)代碼,代碼簡(jiǎn)單易懂,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-11-11
簡(jiǎn)單聊聊Vue中的計(jì)算屬性和屬性偵聽(tīng)
計(jì)算屬性用于處理復(fù)雜的業(yè)務(wù)邏輯,vue提供了檢測(cè)數(shù)據(jù)變化的一個(gè)屬性watch可以通過(guò)newVal獲取變化之后的值,這篇文章主要給大家介紹了關(guān)于Vue中計(jì)算屬性和屬性偵聽(tīng)的相關(guān)資料,需要的朋友可以參考下2021-10-10

