摘要: html结构: <el-date-picker v-model="daterange" :picker-options="daterangeFun" type="datetimerange" placeholder="选择起止时间" :editable="false" :clearable="fal 阅读全文
posted @ 2022-10-26 17:37 田心夂 阅读(29) 评论(0) 推荐(1) 编辑
摘要: 登录注册啥的,不需要下载插件,上图: <template> <div class="about"> <p>当前验证码:{{codeStr}}</p> <canvas id="canvas" width="100" height="43" @click="createCode"></canvas> < 阅读全文
posted @ 2022-10-26 17:24 田心夂 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 注册公共组件,在每个需要的页面直接输入文件名(<g-table/>)即可引用该组件 步骤: 1.新建components/global文件夹,以及components/global/g-table.vue文件。 2.新建untils/globalComponents-register.js,内容: 阅读全文
posted @ 2022-10-26 17:19 田心夂 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1.防抖:n 秒后在执行该事件,若在 n 秒内被重复触发,则重新计时。代码实现重在清零 clearTimeout。 应用:登录,提交,浏览器窗口的resizes事件,文本编辑保存 //防抖函数 function debounce (f, wait) { //设置一个定时器 let timer; re 阅读全文
posted @ 2022-10-26 17:13 田心夂 阅读(4) 评论(0) 推荐(0) 编辑
摘要: let list = [{ id: 1, pid: 0, name: "总公司" }, { id: 2, pid: 1, name: "北京分公司", }, { id: 3, pid: 1, name: "上海分公司", }, { id: 4, pid: 1, name: "深圳分公司", }, { 阅读全文
posted @ 2022-10-26 17:09 田心夂 阅读(1) 评论(0) 推荐(0) 编辑
摘要: function fn(n) { if (n 1 || n 2) { return 1; } return fn(n - 1) + fn(n - 2) } 阅读全文
posted @ 2022-10-26 17:07 田心夂 阅读(4) 评论(0) 推荐(0) 编辑
摘要: function FormNuber(number) { let arr = Math.abs(number).toString().split('').reverse() let i = 3 while (i < arr.length) { arr.splice(i, 0, ',') i += 4 阅读全文
posted @ 2022-10-26 17:04 田心夂 阅读(3) 评论(0) 推荐(0) 编辑
摘要: function toUpperCase(str) { let nstr = str.replace(/(?:_)+([^_])/g, function ($0, $1) { return $1.toUpperCase(); }) nstr = nstr.replace(nstr[0], nstr[ 阅读全文
posted @ 2022-10-26 16:58 田心夂 阅读(4) 评论(0) 推荐(0) 编辑
摘要: function toUnderLine(str) { let nstr = str.replace(/[A-Z]/g, function ($0) { return "_" + $0.toLocaleLowerCase(); }) if (nstr.slice(0, 1) == "_") { ns 阅读全文
posted @ 2022-10-26 16:57 田心夂 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 一、写在前面 数组的map方法,其中需要传入两个参数,第一个是一个回调函数,第二个是一个回调函数的this指向的值。 二、手写 在手写map方法时,我们需要注意如下问题。 1、回调函数必须是一个函数 2、调用该方法的对象必须是数组。 3、如果数组的大小为0,则直接返回空数组 Array.protot 阅读全文
posted @ 2022-10-26 16:16 田心夂 阅读(39) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示