摘要: 由于弹框遮罩层问题,如果绑定鼠标移入移出事件不能顺利,就想着监听鼠标坐标来实现,vue拥有监听器实现简单,就想着用proxy来做一个 如下代码 <template> <div id="x">x:0</div> <div id="y">y:0</div> <div class="myDiv" inde 阅读全文
posted @ 2023-04-21 18:24 lijun12138 阅读(35) 评论(0) 推荐(0) 编辑
摘要: css控制页面横屏显示 /* 当屏幕为竖屏时应用的样式 */ @media screen and (orientation: portrait){ /*要横屏显示的内容的外层盒子*/ #box { /* 设置基准点为左上角 */ transform-origin:top left; /* 以左上角为 阅读全文
posted @ 2023-03-15 10:07 lijun12138 阅读(624) 评论(0) 推荐(0) 编辑
摘要: requestAnimationFrame requestAnimationFrame() 他的作用就是代替定时器做更加流畅高性能的动画,做可以匹配设备刷新率的动画,他解决了定时器做动画时间间隔不稳定的问题(也就是解决定时器做动画不流畅的问题)。他的用法与setTimeout差不多。 与setTim 阅读全文
posted @ 2023-03-13 16:34 lijun12138 阅读(854) 评论(0) 推荐(0) 编辑
摘要: 有时服务器一次返回图片数据很大,一次加载完需要耗费很长时间,这时候,图片懒加载就体现优势 方法一: 通过设置img的src属性来实现懒加载,通过require模拟服务器返回数据 <template> <div class="content" ref="content"> <template v-fo 阅读全文
posted @ 2023-03-07 22:55 lijun12138 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 需求将imgs文件下的图片重命名为规则的命名方式 let fs = require('fs') let path = require('path') //获取文件位置 let url = path.join(__dirname,'/imgs/') fs.readdir(url, (err, file 阅读全文
posted @ 2023-03-07 11:29 lijun12138 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 要实现一个类似于下图的效果,十个标签从中间随机出现的动画效果,若没有十个则按定义位置出现 1.将十个标签都固定在中心位置,通过class,并且动态生成标签颜色 <div class="nodata-icon" v-if="figIsShow"> <div v-if="customerIcon[0]" 阅读全文
posted @ 2023-01-28 15:22 lijun12138 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 简单定义一个拥有create,willStateUpdate和shouldStateUpdate三个类似生命周期的类,名字随意,不要介意 class State { constructor() { this.state = { hehe: "9" }; //第一次调用 this.created(th 阅读全文
posted @ 2022-09-07 14:03 lijun12138 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 主要使用Object的defineProperty为每个属性添加get和set操作,在get和set中添加拦截或者是数据渲染 简单实现//监听 function observe(target) { if (typeof target !== "object" || target "null") { 阅读全文
posted @ 2022-09-07 13:50 lijun12138 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1使用 <ViualList :size="40" :remain="8" :dataList="dataList"> </ViualList> size:每个列表的高度Height remain:当前屏幕展示数据个数 dataList:当前数据 2自定义组件ViualList 根据size和rem 阅读全文
posted @ 2022-08-28 01:07 lijun12138 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 实现如下图效果 点击获取数据按钮出现loading效果 1.定义一个Loading组件 <template> <div v-if="isShow" class="box"> <div class="container"> <div></div> <div></div> <div></div> <di 阅读全文
posted @ 2022-08-25 17:12 lijun12138 阅读(450) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示