2024年10月21日

uniapp授权如何多个权限

摘要: <template> <div> <button @click="handleRequestPermission">拉取权限</button> </div> </template> <script> export default { data() { return { hasMicPermissio 阅读全文

posted @ 2024-10-21 09:56 久居我梦 阅读(30) 评论(0) 推荐(0) 编辑

2024年8月7日

express如何解析multipart/form-data格式的数据

摘要: 最近在学习express,遇到了multipart/form-data请求参数接收不到的问题,控制台打印为{}空对象 问了下AI说是用express内置的方法app.use(express.urlencoded({ extended: true })); 或者下载body-parser使用app.u 阅读全文

posted @ 2024-08-07 16:17 久居我梦 阅读(171) 评论(0) 推荐(0) 编辑

2024年7月30日

鼠标滚动判断dom元素是否在可视区

摘要: 1、利用IntersectionObserver监听dom元素 <div class="box_over"> <ul> <li v-for="(item,index) in 10" :style="`background:rgb(${255 * Math.random() * 2},${255 * 阅读全文

posted @ 2024-07-30 11:35 久居我梦 阅读(59) 评论(0) 推荐(0) 编辑

2024年7月12日

前端如何接收EventStream中的数据?

摘要: 本文目录 1、fetch 2、EventSource fetch fetch是浏览器内置的方法无需下载 fetch("http://127.0.0.1:6594/ws/getAccessToken", { method: "get", }) .then((response) => { const d 阅读全文

posted @ 2024-07-12 11:23 久居我梦 阅读(2320) 评论(0) 推荐(0) 编辑

2024年7月10日

JavaScript如何将字符串形式里的img图片添加属性

摘要: 方法一:使用正则表达式 以下例子中将会在img图片中添加crossorigin属性 let html = `<p>打撒抠脚大汉噶刷卡机很大凯撒</p> <p>规范化是的冯绍峰东风浩荡试试</p> <img src="http://s3.v.360xkw.com/yzb/photos/16885363 阅读全文

posted @ 2024-07-10 15:32 久居我梦 阅读(53) 评论(0) 推荐(0) 编辑

2024年6月18日

实现vue2的响应式原理

摘要: /** * * 基本原理: * 1、通过Observer劫持data上的对象并监听data上的所有属性,遍历所有属性,并用Object.defineProperty转化为getter/setter,监听data上属性的的变化 * 2、将data上的属性挂载到vue的实例上,实例化后可以在vue使用t 阅读全文

posted @ 2024-06-18 16:57 久居我梦 阅读(24) 评论(0) 推荐(0) 编辑

2024年6月15日

JavaScript实现发布与订阅

摘要: 1、代码 class EventBus { constructor(){ this.events = {}; } on(event,handler){ if(!this.events[event]){ this.events[event] = []; } this.events[event].pus 阅读全文

posted @ 2024-06-15 11:38 久居我梦 阅读(17) 评论(0) 推荐(0) 编辑

2024年3月18日

关于scss手动遍历生成类名

摘要: 1、自动生成宽度类名 $width-name:300,100; @each $name in $width-name { .w#{$name}{ width:$name + px; } };//以上代码将会生成 .w300{ width:300px; }; .w100{ width:100px; } 阅读全文

posted @ 2024-03-18 14:25 久居我梦 阅读(104) 评论(0) 推荐(0) 编辑

2024年2月29日

前端解析xlxs导入数据

摘要: uploadCondition(file){ const reader = new FileReader(); let flag = true; reader.onload = (e)=>{ const data = new Uint8Array(e.target.result); const wo 阅读全文

posted @ 2024-02-29 10:19 久居我梦 阅读(44) 评论(0) 推荐(0) 编辑

2024年1月26日

vue的几个小分享

摘要: 1.VNode 钩子 在每个组件或html标签上,我们可以使用一些特殊的(文档没写的)钩子作为事件监听器。这些钩子有: onVnodeBeforeMount onVnodeMounted onVnodeBeforeUpdate onVnodeUpdated onVnodeBeforeUnmount 阅读全文

posted @ 2024-01-26 09:23 久居我梦 阅读(20) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示