Vue3之登录界面

废话不多说上截图

这是一个基于Vue3的项目

首先

引入两个库

@import url('/public/fontawesome-free-6.4.0-web/css/all.min.css');这里是引入第三方库

fontawesome-free-6.4.0-web.zip官方版下载丨最新版下载丨绿色版下载丨APP下载-123云盘

将第三方库解压放到public文件夹下面

 

完整代码来了

<template>
    <div class="title">
        <i v-on:click="this.$router.go(-1);" class="fa-solid fa-chevron-left title-1" style="font-size: 30px;"></i>
        <div class="title-0">
            喜乐安康电商UI
        </div>
    </div>
    <div class="Main">
        <div class="Input1">
            <div class="Img1">
               
            </div>
            <input type="text" v-model="username" placeholder="账号">
        </div>
        <div class="Input2">
            <div class="Img2">
              
            </div>
            <input type="text" v-model="password" placeholder="密码">
            <div class="A">
                <i class="fa-regular fa-eye"></i>
            </div>
        </div>
        <div class="B">
            <input type="radio" name="" id="" :value="true" v-model="remember" v-on:click="this.remember=!remember">
            <div style="color: rgb(255, 0, 0);">
                记住密码
            </div>
            <div class="C">
                忘记密码?
            </div>
        </div>
        <div class="D" >
            <input type="radio" name="" id="" :value="true" v-model="agreement" v-on:click="this.agreement=!agreement">
            同意<div style="color:rgb(43, 170, 164);">《平台协议》</div>和<div style="color:rgb(43, 170, 164);">《隐私协议》</div>
        </div>
        <button class="E">
            登录
        </button>
        <div class="F">
            <div>
                 使用验证码注册
            </div>
           
            <div style="flex-grow: 1;text-align: right;" v-on:click="this.$router.push('/home')">
               游客登录
            </div>
        </div>
    </div>

</template>
<script>
export default {
    data() {
        return {
            remember:false,
            agreement:false,
            username:null,
            password:null,
            code:null,
        }
    },
}
</script>
<style scoped>
.lef-1{
    width: 100%;
    height: 100%;
    flex-grow: 1;
    background-color: rgb(28, 143, 104);

}
.title-0 {
  
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    flex-grow: 1;
}

.title {
    width: 90%;
    height: 60px;
    object-fit: cover;
    /* 调整图片适应方式,保持图片比例并覆盖整个容器 */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    /* 将图片放置在底层,使其成为背景 */
    margin-top: 10px;
    margin-left: 10px;
    display: flex;
    /*默认横向排布*/
    align-items: center;
    /* 垂直居中 */
}

.F {
    width: 90%;
    height: 40px;
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    color: rgb(12, 170, 117);
}

.E {
    background-color: aquamarine;
    width: 90%;
    height: 40px;
    border: none;
    outline: none;
}

.D {
    margin-top: 10px;
    width: 90%;
    height: 40px;
    display: flex;
    /*默认横向排布*/
    align-items: center;
    /* 垂直居中 */

}

.C {
    flex-grow: 1;
    text-align: right;
    margin-right: 3px;
    color: rgb(43, 170, 164);
}

@import url('/public/fontawesome-free-6.4.0-web/css/all.min.css');

.B {
    margin-top: 10px;
    width: 90%;
    height: 40px;
    display: flex;
    /*默认横向排布*/
    align-items: center;
    /* 垂直居中 */
}

.A {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
}

.Input2 input {
    width: 78%;
    border: none;
    outline: none;
    background-color: transparent;
}

.Img2 {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    margin-left: 6px;
}

.Input1 input {
    width: 90%;
    border: none;
    outline: none;
    background-color: transparent;
}

.Img1 {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    margin-left: 6px;
}

.Input1 {
    width: 90%;
    height: 50px;
    background-color: aliceblue;
    border-radius: 50px 50px 50px 50px;
    display: flex;
}

.Input2 {
    width: 90%;
    height: 50px;
    background-color: aliceblue;
    margin-top: 20px;
    border-radius: 50px 50px 50px 50px;
    display: flex;
}

.Main {
    background-color: rgb(241, 239, 236);
    width: 98vw;
    height: 95vh;
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    overflow: hidden;
    flex-direction: column;

    /*纵向排布*/
    ::-webkit-scrollbar {
        display: none;
    }

}</style>

 

  • 15
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
为了实现Vue3炫酷登陆界面,你可以按照以下步骤进行准备和操作: 1. 首先,你需要导入element-plus和particles.vue3这两个包。你可以使用以下命令来导入它们: ```shell # 使用yarn yarn add element-plus particles.vue3 # 使用npm npm install element-plus particles.vue3 --save ``` 2. 导入所需的组件和样式。在你的Vue3项目中,你可以在需要使用的组件中导入element-plus和particles.vue3,并按需加载所需的样式。确保你已经正确配置了vite.config.ts文件,以确保按需加载生效。 3. 在Vue3组件中使用element-plus和particles.vue3。你可以使用element-plus提供的各种组件来构建炫酷的登陆界面,比如按钮、表单、输入框等。同时,你可以使用particles.vue3来添加粒子效果,使登陆界面更加动态和吸引人。 4. 根据你的设计和需求,使用Vue3的模板语法和组件功能构建炫酷的登陆界面。你可以使用element-plus提供的组件来构建表单,处理用户的输入和验证。同时,你可以使用particles.vue3来添加背景粒子效果,提升界面的视觉效果。 记住,在使用element-plus和particles.vue3之前,确保你已经正确导入了这两个包,并按照需要在组件中使用它们。同时,根据你的项目配置和需求,可能需要进行一些额外的配置。 希望这些步骤可以帮助你实现一个炫酷的Vue3登陆界面!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [使用vue3+element-plus+particles实现炫酷(粒子背景)登陆界面](https://blog.csdn.net/m0_61470934/article/details/130240904)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值