随笔分类 -  ES6 7 8 9

ES6-Proxy与数据劫持(12)
摘要:随着前端界的空前繁荣,各种框架横空出世,包括各类mvvm框架百家争鸣,比如Anglar、Vue、React等等,它们最大的优点就是可以实现数据绑定,再也不需要手动进行DOM操作了,它们实现的原理也基本上是脏检查或数据劫持。我们先以Vue框架出发,探索其中数据劫持的奥秘。 Vue 2.0的版本所使用的 阅读全文

posted @ 2020-03-25 10:09 漫思 阅读(339) 评论(0) 推荐(0) 编辑

vue - for 遍历对象和遍历对象数组
摘要:1. 遍历对象时,参数: 第一个为值,第二个为键名,第三个为索引 1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=devic 阅读全文

posted @ 2020-03-18 18:27 漫思 阅读(10353) 评论(0) 推荐(0) 编辑

五分钟搞懂Vuex
摘要:这段时间一直在用vue写项目,vuex在项目中也会依葫芦画瓢使用,但是总有一种朦朦胧胧的感觉。于是决定彻底搞懂它。 看了一下午的官方文档,以及资料,才发现vuex so easy! 作为一个圈子中的人,决定输出一下文档,如果你仔细看完这篇文章,保证你对vuex熟练掌握。 我把自己的代码上传到了git 阅读全文

posted @ 2020-03-16 11:35 漫思 阅读(345) 评论(0) 推荐(0) 编辑

vue 背景图片 backgroundImage background-image vue的style方式绑定行内样式-background-image的方式等~
摘要:<template> <div id="app"> <div class="y_bj" :style="y_bj"></div> </div> </template> <script> import { Toast } from "vant"; export default { data() { r 阅读全文

posted @ 2020-03-13 19:36 漫思 阅读(4404) 评论(1) 推荐(2) 编辑

VUE2.0 vue-cli构建项目中使用Less
摘要:vue-cli 构建的项目默认是不支持 less 的,需要自己添加。 首先,在项目目录下安装 less 和 less-loader。 npm install less less-loader --save-dev 安装成功后,打开 build/webpack.base.conf.js ,在 modu 阅读全文

posted @ 2020-03-11 14:14 漫思 阅读(1778) 评论(0) 推荐(0) 编辑

ES6如何引入图片
摘要:Vue-cli脚手架引入图片的几个方法 1、import方法 第一步:在.vue文件中import edit from 'path'(path是图片与.vue的相对路径) 第三步:在template中 给标签绑定属性 最后刷新界面看效果就可以了! 2、static方法 第一步:图片放在static文 阅读全文

posted @ 2020-03-11 10:31 漫思 阅读(4598) 评论(0) 推荐(0) 编辑

Es6之字符串处理常用方法
摘要:1.字符串的遍历器接口 let text = String.fromCodePoint(0x20BB7); for (let i = 0; i < text.length; i++) { console.log(text[i]); } // " " // " " for (let i of text 阅读全文

posted @ 2020-03-04 23:21 漫思 阅读(6532) 评论(0) 推荐(0) 编辑

ES6 @与..
摘要:在es6里面引入 import { fetchStudent, addStudent, deleteStudentById, updateStudent } from "@/services/student"; 其中@是绝对路径下。 import { fetchStudent, addStudent 阅读全文

posted @ 2020-02-21 22:35 漫思 阅读(963) 评论(0) 推荐(0) 编辑

promise all的怎么处理异常
摘要:在每个promise里面都使用resolve,但是通过数据的不同进行编码不同的返回结果。 在大量的promise里面进行返回时,就会有正确的和错误的,那么我们就会对结果进行二次的筛选。 阅读全文

posted @ 2020-02-17 23:44 漫思 阅读(656) 评论(0) 推荐(0) 编辑

ES6中的class 与prototype
摘要:一、定义构造函数 在以前的js中,生成一个对象实例,需要先定义构造函数,然后通过prototype 的方式来添加方法,在生成实例: function Person(){ this.name = "测试"; this.age = 26; } Person.prototype.getName = fun 阅读全文

posted @ 2020-02-08 23:07 漫思 阅读(820) 评论(0) 推荐(0) 编辑

使用Error和try catch
摘要:<script> function p1() { return new Promise(function (resolve, reject) { reject(new Error("网络错误")) }) } async function Getdata() { try { var t1 = awai 阅读全文

posted @ 2020-02-08 22:29 漫思 阅读(583) 评论(0) 推荐(0) 编辑

我所理解的promise的then方法
摘要:var p1= new Promise(function (resolve, reject) { resolve({ data: [1, 2, 3, 4], resposneCode: "00001", resposneRemark: "成功" }) reject({ resposneCode: " 阅读全文

posted @ 2020-02-08 21:35 漫思 阅读(373) 评论(0) 推荐(0) 编辑

promise与async和await的区别
摘要:什么是Async/Await? async/await是写异步代码的新方式,以前的方法有回调函数和Promise。 async/await是基于Promise实现的,它不能用于普通的回调函数。 async/await与Promise一样,是非阻塞的。 async/await使得异步代码看起来像同步代 阅读全文

posted @ 2020-02-08 21:12 漫思 阅读(33460) 评论(0) 推荐(1) 编辑

JS Promise实例 then()方法
摘要:JS Promise实例 then()方法 内容已更新,可百度搜索: EC前端 Promise.then() 描述: then()方法用于指定当前实例状态发生改变时的回调函数。它返回一个新的Promise实例。 语法: Promise.prototype.then(onFulfilled, onRe 阅读全文

posted @ 2020-02-08 21:05 漫思 阅读(2327) 评论(0) 推荐(0) 编辑

es6----set map应用场景
摘要:1.数组去重 2.字符串去重 属性: Set.prototype.size:返回Set实例的成员总数。 Set 实例的方法分为两大类:操作方法(用于操作数据)和遍历方法(用于遍历成员)。下面先介绍四个操作方法。 add(value):添加某个值,返回 Set 结构本身。 delete(value): 阅读全文

posted @ 2020-02-06 17:49 漫思 阅读(2069) 评论(0) 推荐(0) 编辑

ES6新特性一览
摘要:ES全称ECMAScript,ECMAScript是ECMA制定的标准化脚本语言。目前JavaScript使用的ECMAScript版本为ECMA-417。关于ECMA的最新资讯可以浏览 ECMA news查看。 ECMA规范最终由TC39敲定。TC39由包括浏览器厂商在内的各方组成,他们开会推动J 阅读全文

posted @ 2020-02-06 17:33 漫思 阅读(1430) 评论(0) 推荐(1) 编辑

es6继承
摘要:class Parent { constructor(x,y){ this.x = x; this.y = y; } toString(){ } } class Child extends Parent{ constructor(x,y,color){ super(x,y); this.color 阅读全文

posted @ 2020-02-06 17:24 漫思 阅读(191) 评论(0) 推荐(0) 编辑

es6中class类的全方面理解(一)
摘要:ES6 中的Class javascript 阅读约 4 分钟 基本用法 ES5 的写法 function Point(x, y) { this.x = x; this.y = y; } Point.prototype.toString = function () { return '(' + th 阅读全文

posted @ 2020-02-06 17:22 漫思 阅读(485) 评论(0) 推荐(0) 编辑

Promise的金字教程
摘要:1、常规的调用方法 <script> new Promise(function (resolve, reject) { $.ajax({ url: "GetData", dataType: "JSON", type: "POST", success: function (data) { resolv 阅读全文

posted @ 2020-02-05 23:16 漫思 阅读(154) 评论(0) 推荐(0) 编辑

Async/Await替代Promise的6个理由
摘要:译者按: Node.js的异步编程方式有效提高了应用性能;然而回调地狱却让人望而生畏,Promise让我们告别回调函数,写出更优雅的异步代码;在实践过程中,却发现Promise并不完美;技术进步是无止境的,这时,我们有了Async/Await。 原文: 6 Reasons Why JavaScrip 阅读全文

posted @ 2020-01-16 17:29 漫思 阅读(620) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示