摘要: 点击查看代码 //先是有俩函数 var info = { name: '巴拉拉小魔仙', age: 1000 }; var obj = { title: '震惊!拜登再次摔跤', description: '登机时被风吹倒' }; let activeReactiveFn = null; // 编写 阅读全文
posted @ 2021-12-30 23:04 睡成蛆 阅读(34) 评论(0) 推荐(0) 编辑
摘要: https://stackoverflow.com/questions/51197940/file-name-differs-from-already-included-file-name-only-in-casing-on-relative-p For me, the issue occurred 阅读全文
posted @ 2021-12-19 17:43 睡成蛆 阅读(1241) 评论(0) 推荐(0) 编辑
摘要: 1、Object.getOwnPropertyNames() 返回 对象 自身及原型链上所有的属性名的数组 2、Object.keys() 返回 对象 自身及其原型链上可枚举的属性名的数组 3、for (key in object) 与2、Object.keys()相同 4、Ojbect.value 阅读全文
posted @ 2021-12-11 15:51 睡成蛆 阅读(1800) 评论(0) 推荐(0) 编辑
摘要: 封装一个对cookie操作的模块 废话不说直接上代码 cookie.js 点击查看代码 const set = (name,value,{maxAge,domain,path,secure} = {}) => { let cookieStr = `${encodeURIComponent(name)} = ${encodeURICo 阅读全文
posted @ 2021-12-09 15:57 睡成蛆 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 组件化开发之父子组件之间通信练习,商品页面的切换 最终实现 SFC文件 app组件 点击查看代码 <template> <tab-control :titles='titles' @tabClick="hundleTabClick"></tab-control> <h2>{{contents[currentIndex]}}</h2> </templ 阅读全文
posted @ 2021-12-01 17:44 睡成蛆 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 邂逅Vue3,实现一个简易书籍购物车 效果: html 1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name 阅读全文
posted @ 2021-11-26 12:20 睡成蛆 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 手写实现apply,call,bind 一些小练习,加深对this的动态绑定、闭包的掌握。都是些小demo,没有对传入的参数做很深的检测! 废话不说了,直接上代码 appy 1 var name = '李世海'; 2 var obj = { 3 name:'李虎峰' 4 } 5 6 Function.prototype.shApply = 阅读全文
posted @ 2021-11-23 14:10 睡成蛆 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 手写实现Promise的全部功能 发现的问题 在此过程中,发现 自己对 函数中的this指向,和词法环境 的一些细节没有掌握好,实现过程很痛苦! 解决 应该恶补 下面上代码 1 function Promise(executor){ 2 this.PromiseState = 'pending'; 3 this.PromiseRes 阅读全文
posted @ 2021-11-10 13:36 睡成蛆 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 【VSCode使用Tips】复制内容到上一行,下一行 VSCode使用Tips 阅读全文
posted @ 2021-10-09 00:55 睡成蛆 阅读(841) 评论(0) 推荐(0) 编辑