随笔分类 -  js

摘要:简而言之:就是你用错了 这里的defineProperties应该改为defineProperty https://blog.csdn.net/return_MU/article/details/108121042 阅读全文
posted @ 2022-06-24 20:28 前端路远且长 阅读(338) 评论(0) 推荐(0) 编辑
摘要:window.getComputedStyle(dom, null)['width']; https://blog.csdn.net/weixin_46112225/article/details/121940646 阅读全文
posted @ 2022-06-23 15:25 前端路远且长 阅读(190) 评论(0) 推荐(0) 编辑
摘要:const div = document.createElement('div'); div.className = 'foo'; // 初始状态:<div class="foo"></div> console.log(div.outerHTML); // 使用 classList API 移除、添 阅读全文
posted @ 2022-05-13 13:12 前端路远且长 阅读(243) 评论(0) 推荐(0) 编辑
摘要:e.currentTarget 为 事件所在元素的对象 e.target 为 点击元素的对象 e.target.dataset document.querySelector().dataset 以上都可以获取到自定义属性 data-index 所以e.target=document.querySel 阅读全文
posted @ 2022-05-13 12:58 前端路远且长 阅读(265) 评论(0) 推荐(0) 编辑
摘要:const dfs=(r,c,flow)=>{ flow[r][c]=true let list = [[r-1,c],[r+1,c],[r,c-1],[r,c+1]].forEach(([nr,nc])=>{ if( //保证在矩阵中 nr>=0&&nr<m&& nc>=0&&nc<n&& //防 阅读全文
posted @ 2022-04-22 23:04 前端路远且长 阅读(422) 评论(0) 推荐(0) 编辑
摘要:const text = "abc"; const chars = text.split(''); console.log(chars); //['a', 'b', 'c'] https://blog.csdn.net/lgno2/article/details/118837249 阅读全文
posted @ 2022-04-02 10:23 前端路远且长 阅读(1350) 评论(0) 推荐(0) 编辑
摘要:new Promise((resolve,rej)=>{resolve('1')}).then(r=>console.log(r,'test')).then(r=>{console.log(r,'test2'); return 'b';}).then(r=>{console.log(r)}).cat 阅读全文
posted @ 2022-03-25 10:25 前端路远且长 阅读(38) 评论(0) 推荐(0) 编辑
摘要:let arr = [1, 2, 1, 3, 2, 4, 3, 5, 4] let newArr = [...new Set(arr)] console.log(newArr) https://www.cnblogs.com/zhimao/p/15126281.html 阅读全文
posted @ 2022-03-25 10:03 前端路远且长 阅读(29) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/lgno2/article/details/120775906 阅读全文
posted @ 2022-03-24 09:12 前端路远且长 阅读(31) 评论(0) 推荐(0) 编辑
摘要:初步使用 const arr = [1, [2, 3, 4], 5]; arr.flat(); https://www.cnblogs.com/suihang/p/13606983.html 阅读全文
posted @ 2022-03-23 14:15 前端路远且长 阅读(37) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/hepengqiang/p/9822118.html array.indexOf 返回坐标 array.includes返回true |false array.find返回值 阅读全文
posted @ 2022-03-18 16:23 前端路远且长 阅读(38) 评论(0) 推荐(0) 编辑
摘要:element-ui form表单验证 https://element.eleme.cn/#/zh-CN/component/form js 原生表单验证 https://www.cnblogs.com/xiaobeiju/p/10224130.html <el-form ref="form" :m 阅读全文
posted @ 2022-03-07 10:22 前端路远且长 阅读(553) 评论(0) 推荐(0) 编辑
摘要:官方给我们提供了一个方法来终止循环some(),ervey() https://blog.csdn.net/qq_34451048/article/details/111942317 阅读全文
posted @ 2022-03-01 10:27 前端路远且长 阅读(156) 评论(0) 推荐(0) 编辑
摘要:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries https://baijiahao.baidu.com/s?id=16843877602507975 阅读全文
posted @ 2022-02-22 09:57 前端路远且长 阅读(32) 评论(0) 推荐(0) 编辑
摘要:function test(){ console.log(this) }; test()//运行时this指向window var obj = {name: "李四", age: 20}; test.call(obj)//这样也算是以call指定完上下文再运行,此时this指向obj https:/ 阅读全文
posted @ 2022-02-17 10:40 前端路远且长 阅读(66) 评论(0) 推荐(0) 编辑
摘要:引入的地方加入type="module" https://www.cnblogs.com/threepigs/p/10572114.html 使用的地方也加入type="module" https://blog.csdn.net/you23hai45/article/details/10783574 阅读全文
posted @ 2022-01-25 10:35 前端路远且长 阅读(25) 评论(0) 推荐(0) 编辑
摘要:方法.方法的形式,实际都是对象.方法,也就是第一个方法,返回了一个对象 https://www.zhihu.com/question/438348680 阅读全文
posted @ 2022-01-25 10:09 前端路远且长 阅读(37) 评论(0) 推荐(0) 编辑

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