摘要: 数组的最值 ES6写法:const A = [1,2,3,4,5]; const max = Math.max(...A); 常规写法:var max = Math.max.apply(null,A); var max = Math.max(1,2,3,,4,5) 生成20-30之间的随机整数 Ma 阅读全文
posted @ 2019-07-16 16:37 不负好时光i 阅读(293) 评论(0) 推荐(0) 编辑
摘要: ajax函数,用来与后端的交互(请求类型有POST GET DELETE PUT HEAD,请求地址,callback请求的回调函数,参数,是否异步) function ajax(method, url, callback, data, flag) { // xhr 用来存储请求与响应的信息 var 阅读全文
posted @ 2019-07-14 00:24 不负好时光i 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 第一步:打开命令行工具,在命令行中找到桌面cd Desktop 第二步:给项目起一个名字 vue create vue-app接着会让我们选择预设手动选择Manually select features 跳到另一个命令后选择Babel让浏览器能识别vue,ES6代码,接着选择In package.j 阅读全文
posted @ 2019-07-13 16:45 不负好时光i 阅读(370) 评论(0) 推荐(0) 编辑
摘要: async function async1(){ console.log('async1 start'); await async2(); console.log('async1 end'); } async function async2(){ console.log('async2'); } c 阅读全文
posted @ 2019-07-13 15:48 不负好时光i 阅读(269) 评论(0) 推荐(0) 编辑