ECMAScript 5 特性
这些是 2009 年发布的新特性:
"use strict" 指令
String.trim()
Array.isArray()
Array.forEach()
Array.map()
Array.filter()
Array.reduce()
Array.reduceRight()
Array.every()
Array.some()
Array.indexOf()
Array.lastIndexOf()
JSON.parse()
JSON.stringify()
Date.now()
=================================================================、
ECMAScript 6 是什么?
ECMAScript 6 也称为 ES6 和 ECMAScript 2015。
一些人把它称作 JavaScript 6。
本章介绍 ES6 中的一些新特性。
JavaScript let
JavaScript const
幂 (**)
默认参数值
Array.find()
Array.findIndex()
===================
es6新增特性
1.let和const关键字
2.解构赋值
3.箭头函数
4.模板字符串:使用反引号``代替双引号创建字符串
5.标签模板
6.扩展运算符
7.新增了一些字符串和数组方法
8.Symbol
9.迭代器(Iterator)
10.生成器
11.Promise承诺
https://github.com/lixinlin123a/mimi.git
-----------------------------
vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
// /01这种方式好像不行,不知道什么原因
// devServer: {
// proxy: {
// '/api': { // /api :表示拦截以/api开头的请求路径
// // target: '<url>', // 跨域的域名(不需要写路径)
// // 'https://www.vue-js.com/api/v1/topics', //完整地址
// target: 'https://www.vue-js.com/api', // 跨域的域名(不需要写路径)
// // ws: true, // 是否代理websocked
// changeOrigin: true, // 是否开启跨域
// pathRewrite: { // 重写路径
// '^api': '' // 把/api变为空字符串
// }
// }
// }
// }
// /02这种方式可以解决跨域
devServer: {
proxy: {
'/api': { // /api :表示拦截以/api开头的请求路径
// target: '<url>', // 跨域的域名(不需要写路径)
// 'https://www.vue-js.com/api/v1/topics', //完整地址
target: 'https://www.vue-js.com', // 跨域的域名(不需要写路径)
// ws: true, // 是否代理websocked
changeOrigin: true // 是否开启跨域
// pathRewrite: { // 重写路径
// '^api': '' // 把/api变为空字符串
// }
}
}
}
})