摘要: 1. [] == false; //true这里是因为==符号会bai把两边的类型转换成一样的。这里会转成number[] == 0 // 把false转为number"" == 0 // 用array的valueOf/toString获取基本类型0 == 0 // 空字符串转成数字之后是0,Num 阅读全文
posted @ 2020-08-18 09:21 林中有风 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 应用场景 exact 需要在哪种场景使用 1. 当要匹配路由样式 比如要匹配 to=“/” 但当跳转到其他路由时 to=“/”路由到样式还是存在,因为路由匹配是模糊的 所以要精确匹配 to=“/”路由时候需要加个 exact 来达到精确匹配的目的 2. 当 父路由为 to=“/about” 时候 嵌 阅读全文
posted @ 2020-07-25 23:27 林中有风 阅读(2557) 评论(0) 推荐(0) 编辑
摘要: 在元素上添加 outline 属性 outline: none; 去除视频默认控件 // 在每个控件加上 display: none video::-webkit-media-controls-fullscreen-button { /* display: none; */ } video::-we 阅读全文
posted @ 2020-07-24 16:20 林中有风 阅读(2254) 评论(0) 推荐(0) 编辑
摘要: function* bar() { const result = yield new Promise((resolve, reject) => { setTimeout(() => { resolve('Hello Generator'); }, 3000); }); console.log(res 阅读全文
posted @ 2020-07-23 20:32 林中有风 阅读(241) 评论(0) 推荐(0) 编辑
摘要: var arr3 = []; var arr1 = [['a1','a2', 'a3'],['b1','b2'], ['c1', 'c2', 'c3']]; /* 思路 * 将 arr1[0] 和 arr1[1] 合并 然后保存到 arr3 上作为临时变量 * 再将 arr3 替换 arr1[0] 阅读全文
posted @ 2020-07-10 22:14 林中有风 阅读(630) 评论(0) 推荐(0) 编辑
摘要: ``` 在直接用在函数参数 function Pric(strings, type) { console.log(strings) let s1 = strings[0]; const ret = 20; const who = 16; let showTxt; if(type 'retail') 阅读全文
posted @ 2020-06-08 16:22 林中有风 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 合并 var jsonc = { id: 0, text: "sfas", completed: true } var cs = {...jsonc, completed: false} console.log(cs) // {id: 0, text: "sfas", completed: fals 阅读全文
posted @ 2020-05-27 15:21 林中有风 阅读(107) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>无标题文档</title> <style> p { overflow: hidden; //隐藏多余行数 text-overflow: ellipsis; display: - 阅读全文
posted @ 2020-05-18 14:00 林中有风 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 顾名思义就是 查找传入的对应数据 当数组中的元素在测试条件时返回 true 时, find() 返回符合条件的元素,之后的值不会再调用执行函数。 如果没有符合条件的元素返回 undefined // 定义一个需要被查找的数组 var memoList = [{ id: 1, name: '1' }, 阅读全文
posted @ 2020-04-28 12:03 林中有风 阅读(1380) 评论(1) 推荐(0) 编辑
摘要: filter(过滤) 1 // filter 中的回调函数有一个要求:必须返回一个boolean 2 // true: 当返回 true 时,函数内部回自动将这次回调的 n 加入到新的数组中 3 // false:当返回 false 时,函数内部会过滤掉这次的 n 4 5 const nums = 阅读全文
posted @ 2020-04-23 11:44 林中有风 阅读(170) 评论(0) 推荐(0) 编辑