vue3使用el-form实现登录、注册功能,且进行表单验证(Element Plus中的el-form)

news2024/11/18 13:46:38

简介:Element Plus 中的 el-form 是一个表单组件,用于快速构建表单并进行数据校验。它提供了丰富的表单元素和验证规则,使表单开发变得更加简单和高效。可以搭配el-dialog实现当前页面的登录、注册页 ,这两天在vue3中用到了表单登录,特意记录一下,这里没有封装,直接使用的。

效果:

1、登录页面,弹出框表单

<el-dialog v-model="dialogFormVisible" class="poup_box">

  <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">

          <el-tab-pane label="登录" name="login_one">
            <el-form ref="ruleFormRef" :model="loginForm" :rules="loginRules" class="login_one">
              <el-form-item label="用户" prop="username" v-if="loginStatus">
                <el-input clearable v-model="loginForm.username" autocomplete="off" placeholder="请输入用户名" />
              </el-form-item>
              <el-form-item label="邮箱" prop="email" v-else>
                <el-input v-model="loginForm.email" autocomplete="off" placeholder="请输入邮箱" />
              </el-form-item>
              <el-form-item label="密码" prop="password">
                <el-input v-model="loginForm.password" type="password" show-password autocomplete="off"
                  placeholder="请输入密码" />
              </el-form-item>
              <el-form-item class="forget_item">
                <div @click="changeEmail">
                  <span v-if="loginStatus">邮箱登录</span>
                  <span v-else>用户名登录</span>
                </div>
              </el-form-item>
              <el-form-item class="checks_box">
                <el-checkbox v-model="checked1" size="large" class="checks_inpt" />
                <div class="checks_text">
                  <span>我已阅读并同意</span>
                  <b @click="changeAgreement">服务条款、</b>
                  <b>隐私政策</b>
                </div>
                <div class="userDeal" v-if="userDeal">请阅读并同意协议</div>
              </el-form-item>
              <el-form-item class="login_item">
                <el-button @click="userLogin(ruleFormRef)" :loading="isLoading">
                  <span v-if="isLoading">登录中......</span>
                  <span v-else>登录</span>
                </el-button>
              </el-form-item>
            </el-form>
          </el-tab-pane>

          <el-tab-pane label="注册" name="register_two">
            <el-form ref="ruleFormRef2" :model="registerForm" :rules="registerRules" class="register_two">
              <el-form-item label="用户" prop="username">
                <el-input clearable v-model="registerForm.username" autocomplete="off" placeholder="请输入用户名" />
              </el-form-item>
              <el-form-item label="邮箱" prop="email">
                <el-input v-model="registerForm.email" autocomplete="off" placeholder="请输入邮箱" />
              </el-form-item>
              <el-form-item label="密码" prop="password">
                <el-input v-model="registerForm.password" type="password" show-password autocomplete="off"
                  placeholder="密码由字母、数字或符号组成" />
              </el-form-item>
              <el-form-item label="邮箱验证码" prop="smsCode" class="auth_code">
                <el-input v-model="registerForm.smsCode" autocomplete="off" placeholder="请输入验证码" />
                <div class="auth_text">
                  <span @click="getAuthCode(ruleFormRef2)" v-if="authCodeNum">获取验证码</span>
                  <span class="auth_time" v-else>{{ registerNum }}秒后重发</span>
                </div>
              </el-form-item>
              <el-form-item class="checks_box">
                <el-checkbox v-model="registerCks" size="large" class="checks_inpt" />
                <div class="checks_text">
                  <span>我已阅读并同意</span>
                  <b @click="changeAgreement">服务条款、</b>
                  <b>隐私政策</b>
                </div>
                <div class="userDeal" v-if="registerDeal">请阅读并同意协议</div>
              </el-form-item>
              <el-form-item class="login_item register_item">
                <el-button @click="registerUser(ruleFormRef2)">注册</el-button>
              </el-form-item>
            </el-form>
          </el-tab-pane>

  </el-tabs>

</el-dialog>

2、相关参数,多去少补

import { ElMessage } from 'element-plus'
//import { ref,reactive,toRefs,computed } from 'vue';
//import { useStore } from 'vuex';
import { useRouter, useRoute } from 'vue-router';
//const store = useStore();
const router = useRouter();
//const route = useRoute();
//const state = reactive({});
import { reactive, ref, onMounted } from 'vue';
import func from 'vue-temp/vue-editor-bridge';

const loginStatus = ref(true);//用户/邮箱
const isLoading = ref(false); //按钮loading  
import type { FormInstance, FormRules } from 'element-plus';
const ruleFormRef = ref<FormInstance>()
const ruleFormRef2 = ref<FormInstance>()
// 用户登录还是邮箱登录
function changeEmail() {
  loginStatus.value = !loginStatus.value;
}
// 登录
const loginForm = reactive({
  code: "",
  email: "",
  password: "",
  smsCode: "",
  username: "",
  uuid: ""
})
const loginRules = reactive({
  username: [
    {
      required: true,
      message: '用户名为4~16字符之间(中文、字母、数字或下划线)',
      min: 6, max: 18,
      trigger: 'blur',
    },],
  email: [
    { required: true, message: '请填写正确的邮箱格式', trigger: 'blur' },
    { min: 6, max: 18, message: '邮箱字符为6~18之间', trigger: 'blur' },
  ],
  password: [
    {
      required: true,
      message: '密码为6~18位字母、数字和符号',
      min: 6, max: 18,
      trigger: 'blur',
    },
    // { min: 6, max: 18, message: '密码字符为6~18之间', trigger: 'blur' },
  ],
})
// 注册
const registerForm = reactive({
  code: "",
  email: "",
  password: "",
  smsCode: "",
  username: "",
  uuid: ""
})
const registerRules = reactive({
  username: [
    { required: true, message: '用户名为4~16位之间字符', trigger: 'blur', },
    { min: 4, max: 16, message: '4~16位中文、字母、数字或下划线', trigger: 'blur' },
  ],
  email: [
    { required: true, message: '请填写正确的邮箱格式', trigger: 'blur' },
    { min: 6, max: 18, message: '邮箱为6~18位之间字符', trigger: 'blur' },
  ],
  password: [
    {
      required: true,
      message: '密码为6~18位字符,必须包含字母、数字和符号',
      min: 6, max: 18,
      trigger: 'blur',
    },
  ],
  smsCode: [
    {
      required: true,
      message: '请输入验证码',
      trigger: 'blur',
    },
  ],
})
const checked1 = ref(false);//登录协议
const userDeal = ref(false);//提示用户
const registerCks = ref(false);//注册协议
const registerDeal = ref(false);//注册状态
const authInfo = reactive({})//注册uuid
//登录信息
const loginInfo = reactive({})
// const formLoading = ref(false);
//弹框默认
const dialogFormVisible = ref(false);
//tab默认选中
const activeName = ref('login_one')
//注册/登录
const loginOrRetister = ref(true);
//验证码时间
const registerNum = ref(180);
//文字还是验证码
const authCodeNum = ref(true);

3、事件方法

<script setup lang='ts'>

// tab切换事件
function handleClick(tab, event) {
  const iAgree = document.querySelector(".form_footer");
  if (activeName.value === "register_two") {// 注册
    loginOrRetister.value = true;
    iAgree.style.display = "none";
  } else if (activeName.value === "login_one") {// 登录
    loginOrRetister.value = false;
    iAgree.style.display = "block";
  }
}

// 右上角注册/登录状态切换
function choseResgister() {
  if (loginOrRetister.value === true) {
    loginOrRetister.value = false;
    activeName.value = "register_two";
  } else if (loginOrRetister.value === false) {
    loginOrRetister.value = true;
    activeName.value = "login_one";
  }
}

</script>

这里的Element Plus组件使用的全局引入,所以可以直接使用;

样式大家自己写下吧!

然后点击登录、注册时,表单里的输入框验证,也有做,但是有时管用,有时不管用,这里给大家文档地址,自己看吧!

表单验证icon-default.png?t=N7T8https://element-plus.org/zh-CN/component/form.html#%E8%A1%A8%E5%8D%95%E6%A0%A1%E9%AA%8C​​​​​​​

表单校验详情页icon-default.png?t=N7T8https://element-plus.run/#eyJzcmMvQXBwLnZ1ZSI6Ijx0ZW1wbGF0ZT5cbiAgPGVsLWZvcm1cbiAgICByZWY9XCJydWxlRm9ybVJlZlwiXG4gICAgOm1vZGVsPVwicnVsZUZvcm1cIlxuICAgIDpydWxlcz1cInJ1bGVzXCJcbiAgICBsYWJlbC13aWR0aD1cIjEyMHB4XCJcbiAgICBjbGFzcz1cImRlbW8tcnVsZUZvcm1cIlxuICAgIDpzaXplPVwiZm9ybVNpemVcIlxuICAgIHN0YXR1cy1pY29uXG4gID5cbiAgICA8ZWwtZm9ybS1pdGVtIGxhYmVsPVwiQWN0aXZpdHkgbmFtZVwiIHByb3A9XCJuYW1lXCI+XG4gICAgICA8ZWwtaW5wdXQgdi1tb2RlbD1cInJ1bGVGb3JtLm5hbWVcIiAvPlxuICAgIDwvZWwtZm9ybS1pdGVtPlxuICAgIDxlbC1mb3JtLWl0ZW0gbGFiZWw9XCJBY3Rpdml0eSB6b25lXCIgcHJvcD1cInJlZ2lvblwiPlxuICAgICAgPGVsLXNlbGVjdCB2LW1vZGVsPVwicnVsZUZvcm0ucmVnaW9uXCIgcGxhY2Vob2xkZXI9XCJBY3Rpdml0eSB6b25lXCI+XG4gICAgICAgIDxlbC1vcHRpb24gbGFiZWw9XCJab25lIG9uZVwiIHZhbHVlPVwic2hhbmdoYWlcIiAvPlxuICAgICAgICA8ZWwtb3B0aW9uIGxhYmVsPVwiWm9uZSB0d29cIiB2YWx1ZT1cImJlaWpp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sZW1lbnQtcGx1cy9nbG9iYWwuZC50c1wiXVxuICB9LFxuICBcInZ1ZUNvbXBpbGVyT3B0aW9uc1wiOiB7XG4gICAgXCJ0YXJnZXRcIjogMy4zXG4gIH1cbn1cbiIsIl9vIjp7fX0=

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1001579.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

微信小程序 按钮颜色

<button type"primary">主要按钮样式类型</button> <button type"default">默认按钮样式类型</button> <button type"warn">警告按钮样式类型</button> <view>按钮plain是否镂空</view> <bu…

全局光照RSM

Reflective Shadow Maps&#xff08;RSM&#xff09; 一切被直接光照照到的物体&#xff0c;会作为次级光源。 问题1&#xff1a;哪些面片被直接照亮 使用ShadowMap就可以知道哪些面片被直接照亮 问题2&#xff1a;各个面片对P点的贡献分别是多少。 对渲染方程代入如上计算…

CRM客户管理系统能在线使用吗?

经常有朋友私信小编&#xff0c;mac系统/windows系统可以下载使用吗&#xff1f;在哪里下载&#xff1f;其实&#xff0c;Zoho CRM在线即可使用&#xff0c;完全不用下载客户端&#xff01;下面我们就说说&#xff0c;CRM管理系统如何在线用。 Zoho CRM是一款帮助企业进行客户…

恒运资本:什么是五日线?

在股票买卖中&#xff0c;五日线是一种常见的技术剖析指标&#xff0c;用于判别股市的趋势和价格改变。五日线也被称为移动平均线&#xff0c;它是以最近五个买卖日的收盘价为基础核算出的平均值。五日线能够协助出资者识别短期商场意向&#xff0c;及时调整出资战略&#xff0…

Mybatis 框架 ( 四 ) QueryWrapper

4.5.Wrapper条件构造器 Wrapper &#xff1a; 条件构造抽象类&#xff0c;最顶端父类 AbstractWrapper &#xff1a; 用于查询条件封装&#xff0c;生成 sql 的 where 条件 QueryWrapper &#xff1a; Entity 对象封装操作类&#xff0c;不是用lambda语法 UpdateWrapper &am…

【前端】禁止别人调试自己的前端页面代码

无限debugger 前端页面防止调试的方法主要是通过不断 debugger 来疯狂输出断点&#xff0c;因为 debugger 在控制台被打开的时候就会执行由于程序被 debugger 阻止&#xff0c;所以无法进行断点调试&#xff0c;所以网页的请求也是看不到的代码如下&#xff1a; /** * 基础禁止…

参照错误原因排查

报错如下&#xff0c;弹框参照框不显示&#xff1a; 首先定位到错误代码行&#xff0c;排查后发现调用方式、参数均没问题 再到参照引入源头&#xff0c;结合network检测资源加载情况&#xff0c;发现静态资源js文件均正常获取 可以基本判断是参照组件那边出现问题&#xff0c…

算法通关村第十八关——回溯是怎么回事(青铜)

算法通关村第十八关——回溯是怎么回事&#xff08;青铜&#xff09; 前言1. 从N叉树说起1.1 N叉树的定义和特点1.2 N叉树的遍历方式1.3 N叉树在回溯算法中的应用 2. 为什么有的问题暴力搜索也不行2.1 暴力搜索的局限性 3. 回溯递归局部枚举放下前任3.1 回溯算法的基本思想和原…

运维Shell脚本牛刀小试(九): 重定向操作符“>“及双重定向“>>“

运维Shell脚本小试牛刀(一) 运维Shell脚本小试牛刀(二) 运维Shell脚本小试牛刀(三)::$(cd $(dirname $0)&#xff1b; pwd)命令详解 运维Shell脚本小试牛刀(四): 多层嵌套if...elif...elif....else fi_蜗牛杨哥的博客-CSDN博客 Cenos7安装小火车程序动画 运维Shell脚本小试…

c高级day4(9.11)shell脚本(case ....in语句,循环语句,select ...in和case...In结合,辅助控制关键字,函数)

1.实现一个对数组就和的函数&#xff0c;数组通过实参传递给函数 2.写一个函数&#xff0c;输出当前用户的uid和gid&#xff0c;并使用变量接收结果 #!/bin/bash read -a arr sum0 function add() { …

s2019nh62分数减法

代码&#xff1a; #include<bits/stdc.h> using namespace std; int m1,z1,m2,z2,zd,zx,s1,s2,f1,f2,c,da; int main() {cin>>z1>>m1; //分子1和分母1cin>>z2>>m2; //分子2和分母2zd__gcd(m1,m2); //求两个分母的最大公因数来求最小公倍数z…

数据分析工具有哪些,哪个好学?

Tableau、帆软BI、思迈特BI、SpeedBI数据分析云……这些都是比较常见的BI数据分析工具。从学习成本、操作难度以及数据可视化分析效果来看&#xff0c;SpeedBI数据分析云都表现地可圈可点。 1、不需下载安装、学习成本低 SpeedBI数据分析云是一款SaaS BI数据分析工具&#xf…

IO和进程day05(进程与线程)

今日任务 1.代码 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #include <pthread.h>…

pytorch代码实现之CoordConv卷积

CoordConv卷积 在深度学习领域&#xff0c;几乎没有什么想法能像卷积那样产生如此大的影响。对于任何涉及像素或空间表示的问题&#xff0c;普遍的直觉认为卷积神经网络可能是合适的。在本文中&#xff0c;我们通过看似平凡的坐标变换问题展示了一个惊人的反例&#xff0c;该问…

如何使用bat脚本启动指定目录下的jar包

士别三日&#xff0c;当刮目相待。——《三国志》 为了将一个java程序封装成一个简单易用的小工具&#xff0c;使用bat脚本启动jar包。 在txt文档中&#xff0c;键入&#xff1a; echo off java -jar %~dp0core\demo.jar 注意&#xff1a; 1、其中“core”是文件夹的名称&am…

与读者互动,扩大影响:提升公众号文章阅读量的关键

如何提升公众号文章阅读量 公众号已成为许多个人和企业推广与传播的重要平台。然而&#xff0c;仅仅拥有一个公众号并发布文章并不足以吸引大量读者和提高阅读量。在当今信息爆炸的时代&#xff0c;如何让你的公众号文章脱颖而出并吸引更多读者的关注是一个关键问题。本文将为…

气象观测站:实时监测、应用广泛

对于许多人来说&#xff0c;气象观测站可能只是一种能够预测天气的设备&#xff0c;但实际上&#xff0c;它所涉及的原理和优势却远不止于此。 二、气象观测站的优势 全面覆盖 气象观测站能够全面覆盖气象要素的各个方面&#xff0c;从温度、湿度、气压到风速、风向等。这些…

日志是你的朋友:为什么每个开发者都应该写日志

大家好&#xff0c;我是小米&#xff0c;一个热衷于技术分享的程序员。今天我想和大家聊一聊一个在编写代码时常常被忽视&#xff0c;却极为重要的话题——为什么要写有意义的日志。 在日常的编程工作中&#xff0c;我们经常听到“日志”这个词&#xff0c;但是有些人可能并不…

C++重载输入和输出运算符

在C++中,标准库本身已经对左移运算符<<和右移运算符>>分别进行了重载,使其能够用于不同数据的输入输出,但是输入输出的对象只能是 C++ 内置的数据类型(例如 bool、int、double 等)和标准库所包含的类类型(例如 string、complex、ofstream、ifstream 等)。 …

C 风格文件输入/输出---无格式输入/输出---(std::getchar,std::putchar,std::ungetc)

C 标准库的 C I/O 子集实现 C 风格流输入/输出操作。 <cstdio> 头文件提供通用文件支持并提供有窄和多字节字符输入/输出能力的函数&#xff0c;而 <cwchar>头文件提供有宽字符输入/输出能力的函数。 无格式输入/输出 从 stdin 读取字符 std::getchar int getch…