随笔分类 -  es6

摘要:1.通过点击链接(后端返回url) window.location.href = url 2.解析后端返回的文件流 downOrder(){ let form ={} this.$axios({ method:'post',//请求方式 headers:{ 'token':'this.token', 阅读全文
posted @ 2022-04-28 14:54 小基狠努力啊 阅读(612) 评论(0) 推荐(0) 编辑
摘要:1.const常量的使用 const 不能重复声明 const 不属于顶层对象window const不存在变量提升 暂时性死区 块级作用域 2.正常来说const是不可改变的常量,但是const在有些地方是可以被改变的 const 声明基本数据类型的时候。number , 布尔,字符串,undef 阅读全文
posted @ 2021-12-10 16:28 小基狠努力啊 阅读(128) 评论(0) 推荐(0) 编辑
摘要:1.环境构建 安装Node.js环境:https://nodejs.org/zh-cn/ 进入到项目,初始化package.json : npm init -y 安装:npm instaall --save-dev babel-preset-env babel-cli 创建文件夹并配置:.babel 阅读全文
posted @ 2021-12-10 16:03 小基狠努力啊 阅读(39) 评论(0) 推荐(0) 编辑
摘要:解构赋值正确使用的形式 1.函数的参数 2.函数的返回值 3.变量交换 4.JSON应用 5.Ajax请求应用 //函数的参数 解构赋值 // const sum = arr =>{ // let result = 0; // for(let i=0; i<arr.length;i++){ // r 阅读全文
posted @ 2021-12-10 11:39 小基狠努力啊 阅读(65) 评论(0) 推荐(0) 编辑
摘要:一、解构赋值 //对象 const course = { name:'es6', price: 200 }; //按照正常写法,我们会这样来写 // const name = course.name; // const price = course.price; //es6的简单写法 const { 阅读全文
posted @ 2021-12-09 14:51 小基狠努力啊 阅读(57) 评论(0) 推荐(0) 编辑
摘要:es6中不是所有场景中都能使用,以下场景中不能使用 1、箭头函数作为事件的回调函数,this指向会往上层找,要注意 2、使用箭头函数定义对象中的方法时,this指向外部(window) 3、通过箭头函数定义的函数中不能使用arguments对象 4、不能使用箭头函数作为构造函数去使用 5、使用箭头函 阅读全文
posted @ 2021-12-09 13:53 小基狠努力啊 阅读(51) 评论(0) 推荐(0) 编辑

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