摘要: https://blog.csdn.net/j_bleach/article/details/53047467 https://www.cnblogs.com/flyingzeng/p/10536690.html https://zhuanlan.zhihu.com/p/162049537 http 阅读全文
posted @ 2021-06-23 20:26 红羽毛学习站 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 类必须使用new调用,否则会报错。这是它跟普通构造函数的一个主要区别,后者不用new也可以执行。 class Foo { constructor() { return Object.create(null); } } Foo() // TypeError: Class constructor Foo 阅读全文
posted @ 2021-03-01 10:41 红羽毛学习站 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 模块功能主要由两个命令构成:export和import。export命令用于规定模块的对外接口,import命令用于输入其他模块提供的功能。 // ES6模块 import { stat, exists, readFile } from 'fs'; “编译时加载”或者静态加载,即 ES6 可以在编译 阅读全文
posted @ 2021-02-26 09:11 红羽毛学习站 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1、$router跟$route的区别 $route route是路由信息对象,里面主要包含路由的一些基本信息,包括name、meta、path、hash、query、params、fullPath、matched、redirectedFrom $router router是VueRouter的实例 阅读全文
posted @ 2021-02-23 13:53 红羽毛学习站 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 二进制和八进制表示法 ES6 提供了二进制和八进制数值的新的写法,分别用前缀0b(或0B)和0o(或0O)表示。 0b111110111 503 // true 0o767 503 // true 从 ES5 开始,在严格模式之中,八进制就不再允许使用前缀0表示,ES6 进一步明确,要使用前缀0o表 阅读全文
posted @ 2021-02-04 18:06 红羽毛学习站 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 函数参数的默认值 function log(x, y = 'World') { console.log(x, y); } log('Hello') // Hello World log('Hello', 'China') // Hello China log('Hello', '') // Hell 阅读全文
posted @ 2021-02-04 18:04 红羽毛学习站 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 扩展运算 如果将扩展运算符用于数组赋值,只能放在参数的最后一位,否则会报错。 const [...butLast, last] = [1, 2, 3, 4, 5]; // 报错 const [first, ...middle, last] = [1, 2, 3, 4, 5]; // 报错1、字符串转 阅读全文
posted @ 2021-02-04 17:32 红羽毛学习站 阅读(48) 评论(0) 推荐(0) 编辑
摘要: !(function (doc, win) { var el = doc.documentElement;//html //resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; //设置html的字体 阅读全文
posted @ 2021-01-28 08:11 红羽毛学习站 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 添加<meta name="viewport" content="width=device-width,initial-scale=1.0"> 自动的适应了手机端和pc端 首先,meta标签存储的是一些用户不可见,但是浏览器可见的一些元信息,一般以键值对的方式存储。 比如这个 <meta name= 阅读全文
posted @ 2021-01-26 18:58 红羽毛学习站 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 情况1:如果一个函数中有this,但是它没有被上一级的对象所调用,那么this指向的就是window,这里需要说明的是在js的严格版中this指向的不是window,但是我们这里不探讨严格版的问题,你想了解可以自行上网查找。 情况2:如果一个函数中有this,这个函数有被上一级的对象所调用,那么th 阅读全文
posted @ 2021-01-25 09:51 红羽毛学习站 阅读(90) 评论(0) 推荐(0) 编辑