摘要: //添加.replace(/=+$/,'') replace(/[\r\n]/g,"")为了解决由于base64图片补码的问题导致的 this.$nextTick(()=>{ let urlType = '',base64code = '' if(type.toUpperCase() 'PDF'){ 阅读全文
posted @ 2024-04-17 17:38 磊~~ 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://www.cnblogs.com/zhangzl419/p/15210835.html 1、什么时候使用npm link? npm link用来在本地项目和本地npm包之间建立连接,可以在本地进行模块测试。 npm包在开发和迭代更新时,不适合直接发布到线上或者直接发布测试版 阅读全文
posted @ 2024-04-15 15:30 磊~~ 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 身份证验证: /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dxX]$/ 这个正则表达式的含义是: - ^[1-9]\d{5} :匹配地区码,1-9开头的6位数字 - (19|20)\d{2} :匹配年份,19或 阅读全文
posted @ 2024-04-10 11:50 磊~~ 阅读(1) 评论(0) 推荐(0) 编辑
摘要: <el-image style="width: 300px; height: 150px" :src="url" :preview-src-list="srcList"> </el-image> this.url='data:image/png;base64,' + row.PAGE_IMG 其他格 阅读全文
posted @ 2024-04-09 15:09 磊~~ 阅读(15) 评论(0) 推荐(0) 编辑
摘要: <template> <div class="box" :style="styleVar"> </div> </template> <script> export default { props: { height: { type: Number, default: 54, }, }, comput 阅读全文
posted @ 2024-03-05 10:40 磊~~ 阅读(17) 评论(0) 推荐(0) 编辑
摘要: export default defineConfig(() => { // 这里只加入了element的有其他的也加在这里 const optimizeDepsElementPlusIncludes = ['element-plus/es']; // 预加载element样式 有其他组件也是如此设 阅读全文
posted @ 2023-09-07 17:35 磊~~ 阅读(68) 评论(0) 推荐(0) 编辑
摘要: { "compilerOptions": { // ↓指定ECMAScript目标版本,esnext为最新版本 "target": "esnext", // ↓指定生成哪个模块系统代码,esnext为最新版本 "module": "esnext", // ↓决定如何处理模块。 "moduleReso 阅读全文
posted @ 2023-05-30 14:41 磊~~ 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 一、删除最后一次提交 这种情况比较简单,主要操作分两步: 第一步:回滚上一次提交 git reset --hard HEAD^ 第二步:强制提交本地代码 git push origin master -f 阅读全文
posted @ 2023-03-28 17:01 磊~~ 阅读(44) 评论(0) 推荐(0) 编辑
摘要: const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent ) ? "Mobile" : "Desktop"; co 阅读全文
posted @ 2023-01-29 09:00 磊~~ 阅读(20) 评论(0) 推荐(0) 编辑
摘要: const callback = (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { // `entry.target` is the dom element console.log(`${entry.tar 阅读全文
posted @ 2023-01-29 09:00 磊~~ 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 清除浮动方式 2:父级定义 overflow:hidden;zoom:1(针对 ie6 的兼容) 3:给塌陷的元素添加伪对象.father:after{Content:“随便写”;Clear:both;display:block;Height:0;Overflow:hidden;Visibility 阅读全文
posted @ 2022-12-06 15:22 磊~~ 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 在CSS3中,我们可以使用transform属性的scale()方法来实现元素的缩放效果。缩放,指的是“缩小”和“放大”的意思。 transform: scaleX(x); / 沿x轴方向缩放/ transform: scaleY(y); / 沿y轴方向缩放/ transform: scale(); 阅读全文
posted @ 2022-12-05 09:23 磊~~ 阅读(641) 评论(0) 推荐(0) 编辑
摘要: filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filte 阅读全文
posted @ 2022-12-01 10:35 磊~~ 阅读(24) 评论(0) 推荐(0) 编辑
摘要: (28条消息) vue + css-vars-ponyfill 实现动态换肤_MrWangJB的博客-CSDN博客 阅读全文
posted @ 2022-10-18 09:16 磊~~ 阅读(22) 评论(0) 推荐(0) 编辑
摘要: { "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck" 阅读全文
posted @ 2022-09-14 17:08 磊~~ 阅读(23) 评论(0) 推荐(0) 编辑
摘要: uuid npm install -S uuid import { v4 } from 'uuid' this.uuId = v4() 生成随机id nanoid 1.安装nanoid库 npm i nanoid 2.引入nanoid import {nanoid} from 'nanoid' 3. 阅读全文
posted @ 2022-08-25 10:06 磊~~ 阅读(371) 评论(0) 推荐(0) 编辑
摘要: vuex 阅读全文
posted @ 2022-08-21 21:33 磊~~ 阅读(5) 评论(0) 推荐(0) 编辑
摘要: mounted() { window.addEventListener('beforeunload', e => this.beforeunloadHandler(e)) //监听页面刷新触发事件 }, methods(){ beforeunloadHandler(e) { //根据事件进行操作进行 阅读全文
posted @ 2022-08-19 16:59 磊~~ 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 先执行宏任务,当宏任务执行完成之后在执行微任务,如果微任务执行完成了,还存在宏任务在次执行宏任务,然后继续执行微任务。。。。。。 阅读全文
posted @ 2022-07-22 17:48 磊~~ 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 数字滚动效果插件 vue-count-to vue-animate-number 阅读全文
posted @ 2022-07-22 10:18 磊~~ 阅读(124) 评论(0) 推荐(0) 编辑
摘要: <el-button type="primary" plain round @click="stop">stop</el-button> const stop = watchEffect((onInvalidate) => { console.log(massage.value); onInvali 阅读全文
posted @ 2022-07-20 16:38 磊~~ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 1、导航被触发。 2、在失活的组件里调用 beforeRouterLeave 守卫。 3、调用全局的 beforeEach 守卫。 4、在重用的组件调用 beforeRouterUpdate 守卫(2.2+)。 5、在路由配置里面 beforeEnter。 6、解析异步路由组件。 7、在被激活的组件 阅读全文
posted @ 2022-07-18 11:32 磊~~ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: data() { return { params: { a: 1, b: 2, c: 3, d: 4 }, }; }, watch: { params: { deep: true, handler() { this.getList; }, }, } 但是如果我只想要a,b改变时重新请求,c,d改变时 阅读全文
posted @ 2022-07-18 10:54 磊~~ 阅读(431) 评论(0) 推荐(0) 编辑
摘要: slice 方法可以用来将一个类数组(Array-like)对象/集合转换成一个新数组。你只需将该方法绑定到这个对象上。 一个函数中的 arguments 就是一个类数组对象的例子 function list() { return Array.prototype.slice.call(argumen 阅读全文
posted @ 2022-07-12 17:34 磊~~ 阅读(23) 评论(0) 推荐(1) 编辑
摘要: (34条消息) Promise.then链式调用顺序_高先生的猫的博客-CSDN博客_promise的链式执行顺序 阅读全文
posted @ 2022-07-12 15:51 磊~~ 阅读(25) 评论(0) 推荐(0) 编辑
摘要: import Vue from 'vue'; import Router from 'vue-router'; // 官网可知:下面没有指定webpackChunkName,每个组件打包成一个js文件。 const Foo = () => import('../components/Foo') co 阅读全文
posted @ 2022-07-12 14:09 磊~~ 阅读(983) 评论(0) 推荐(0) 编辑
摘要: let a = document.createElement("a") a.href = "/static/config/file/产品服务目录.xlsx" a.download = "产品服务目录.xlsx" a.style.display = "none" document.body.appen 阅读全文
posted @ 2022-07-12 10:20 磊~~ 阅读(15) 评论(0) 推荐(0) 编辑
摘要: typeof用于数据类型的判断,返回值有number、string、boolean、function、undefined、object 等 instanceof他的判断就是根据原型链进行搜寻,在对象obj1的原型链上如果存在另一个对象obj2的原型属性,那么表达式(obj1 instanceof o 阅读全文
posted @ 2022-07-09 17:35 磊~~ 阅读(21) 评论(0) 推荐(0) 编辑
摘要: <div class="svg"> <img src="./firefox-logo.svg" class="svg-color"> </div> //css .svg { width: 30px; height: 30px; overflow: hidden; } .svg-color { tra 阅读全文
posted @ 2022-06-30 14:09 磊~~ 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Interactive CSS Grid Generator | Layoutit Grid grid布局 双栏布局非常常见,往往是以一个定宽栏和一个自适应的栏并排展示存在 实现思路也非常的简单: 使用 float 左浮左边栏 右边模块使用 margin-left 撑出内容块做内容展示 为父级元素添 阅读全文
posted @ 2022-06-24 10:09 磊~~ 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Set、Map、WeakSet、WeakMap、都是一种集合的数据结构 Set、WeakSet 是[值,值]的集合,且具有唯一性 Map 和 WeakMap 是一种[键,值]的集合,Map 的键可以是任意类型,WeakMap 的键只能是对象类型 Set 和 Map 有遍历方法,WeakSet 和 W 阅读全文
posted @ 2022-06-19 22:02 磊~~ 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-06-19 20:51 磊~~ 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1.offsetTop :当前对象到其上级层顶部的距离.不能对其进行赋值.设置对象到页面顶部的距离请用style.top属性. 2.offsetLeft :当前对象到其上级层左边的距离.不能对其进行赋值.设置对象到页面左部的距离请用style.left属性. 3.offsetWidth :当前对象的 阅读全文
posted @ 2022-06-16 11:10 磊~~ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: <html> <head> <title>前端的base64使用方法</title> </head> <body> </body> <script> var str = "hello"; var str64 = window.btoa("hello"); console.log("字符串是:"+st 阅读全文
posted @ 2022-05-25 12:36 磊~~ 阅读(4688) 评论(0) 推荐(0) 编辑
摘要: 1、serve安装npm i -g serve 使用serve -p 8000 2、live-server安装npm install -g live-server 使用live-server 或者 live-server --port=8000 阅读全文
posted @ 2022-05-23 16:56 磊~~ 阅读(271) 评论(0) 推荐(0) 编辑
摘要: git add .git commit amend 修改最近一次提交的信息git checkout dev #切换到dev开发分支 git pull git checkout master git merge dev #合并dev分支到master上 git push origin master # 阅读全文
posted @ 2022-01-14 09:36 磊~~ 阅读(28) 评论(0) 推荐(0) 编辑
摘要: export default { name: 'page-index', data(){ return{ windowWidth: document.documentElement.clientWidth, //实时屏幕宽度 windowHeight: document.documentElemen 阅读全文
posted @ 2021-12-16 17:12 磊~~ 阅读(3037) 评论(0) 推荐(0) 编辑
摘要: color: $color-3399E5; &::before{ content: ""; position: absolute; top: 0; left: 0; border-bottom: 2px solid $color-3399E5; padding-top: 5px; width: 0; 阅读全文
posted @ 2021-12-16 10:44 磊~~ 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 在基于vue项目开发的时候遇到一个小需求,由于项目部署环境的变更,导致前端工程中一些全局配置需要经常修改,而之前每次变更都需要重新打包发布,耗时太长操作也麻烦,于是参考网上的一些解决方案在项目中增加了一个 globalConfig.js 全局配置文件,支持打包完成后修改该文件中对应配置项刷新浏览器即 阅读全文
posted @ 2021-10-27 09:39 磊~~ 阅读(580) 评论(0) 推荐(0) 编辑
摘要: 一、引言 代码规范提交可以很好的保存代码修改日志,规范提交日志对于定位问题或代码回退具有极大意义。 二、使用插件列表 commitizen cz-conventional-changelog conventional-changelog-cli 1. commitizen 规范代码的提交 1.1 n 阅读全文
posted @ 2021-10-20 15:53 磊~~ 阅读(587) 评论(0) 推荐(0) 编辑