03 2024 档案
摘要:登录 表单验证,正则判断 账号密码输入没问题点击登录或者输入手机号发验证码,验证码要做倒计时 验证码倒计时 let phoneTimer = null; //倒计时 const sendCode = () => { let timer = 10; captcha.value = `重新发送10秒`;
阅读全文
摘要:当前使用Vite做为开发构建工具,而Vite默认不支持使用require方式进行模块导入导出 可以使用vite-plugin-require-transform插件来处理 安装npm install vite-plugin-require-transform 在vite.config.js中添加 i
阅读全文
摘要:安装pinia npm install pinia 创建一个store/index.js import { createPinia } from 'pinia' //从pinia模块导入createPinia函数。Pinia是Vue.js的一个状态管理库,createPinia函数用于创建一个新的P
阅读全文
摘要:在utils文件夹创建一个aes.js文件 安装 cnpm install crypto-js import CryptoJS from "crypto-js"; const key = CryptoJS.enc.Utf8.parse(""); //十六位十六进制数作为密钥 const iv = C
阅读全文
摘要:这里用的是vue3 原来的写法不封装,直接卸载onBeforeMount内 onBeforeMount(() => { getSecondCategorys({ pageNum: 1, pageSize: 8 }).then((res) => { secondList.value = res.dat
阅读全文
摘要:原理不清楚,记录一下 效果 点击哪个页面展示哪个 路由中 { path: "/news", name: "news", children: [ { path: "/news/:id", 这里固定 name: "newsId", 这里命名随意 component: () => import("../c
阅读全文
摘要:在dom中 <div ref="box">12345 </div> 在mounted中 console.log(this.$refs.box)
阅读全文
摘要:1.nextTick是在所有东西执(onload)行完之后,最后执行的 2.想要获取更新后的dom可以使用 this.$nextTick 3.想在beforeCreate.created.beforeMount中获取dom可以使用$nextTick
阅读全文
摘要:创建一个新函数的时候,js会为默认该函数创建一个prototype属性,这个属性值是一个原型对象,这个对象里默认有一个constructor构造函数属性,constructor属性的值是这个函数
阅读全文