2022年5月18日
摘要: 打印一下 this.$refs[formName],检查是否拿到了正确的需要验证的 form 在拿到了正确的 form 后,检查该 form 上添加的表单验证是否正确,需要注意的点有: el-form rules,model 属性绑定,ref 标识 el-form-item prop 属性绑定 <F 阅读全文
posted @ 2022-05-18 17:56 pleaseAnswer 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 全局模式捕获:String.prototype.matchAll() const str = ` <html> <body> <div>这是第一个div</div> <p>这是p</p> <div>这是第二个div</div> <span>这是span</span> </body> </html 阅读全文
posted @ 2022-05-18 17:46 pleaseAnswer 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1 对象扩展 Object.fromEntries() 把键值对列表转换为一个对象 1.1 Object 转换 const obj = { name: 'imooc', course: 'es' } const entries = Object.entries(obj) console.log(en 阅读全文
posted @ 2022-05-18 17:41 pleaseAnswer 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 1 异步迭代:for await of 1.1 同步迭代(模拟) const arr = ['es6', 'es7', 'es8', 'es9'] // 只适用于同步操作 arr[Symbol.iterator] = function() { let nextIndex = 0 return { n 阅读全文
posted @ 2022-05-18 17:37 pleaseAnswer 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 1 异步编程解决方案 Async Await async 让我们写起 Promise 像同步操作 async/await 是函数定义的关键字 await 用于等待 promise 对象的返回结果,且不能单独使用必须放在 async 函数中 利用 async 定义的函数会返回一个 promise 对象 阅读全文
posted @ 2022-05-18 17:30 pleaseAnswer 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 1 数组扩展:Array.prototype.includes(searchElement, fromIndex) fromIndex 从指定索引位置开始查找 1.1 返回值:Boolean const arr = ['es6', 'es7', 'es8'] console.log(arr.incl 阅读全文
posted @ 2022-05-18 17:27 pleaseAnswer 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 1 异步操作必备知识 1.1 异步操作前置知识 1. js 是单线程的 2. 同步任务与异步任务 3. ajax 原理 前后端数据分离 前端 ↔ 后端 ajax 4. callback hell 回调地狱 2 Ajax 原理与 Callback Hell 2.1 ajax 原理 一种前后端的交互方式 阅读全文
posted @ 2022-05-18 17:17 pleaseAnswer 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 1 面向过程与面向对象 1.1 冰箱装大象 js是一种基于对象(object-based)的语言 1.2 类与对象 类是对象的模板,定义了同一组对象共有的属性和方法 2 ES5中的类与继承 2.1 类 1. 如何定义类 属性定义在类上 方法定义在原型上 function People(name, a 阅读全文
posted @ 2022-05-18 17:05 pleaseAnswer 阅读(15) 评论(0) 推荐(0) 编辑