03 2021 档案

摘要:数组扁平化 const arr = [1, 2, 3, [4, [5, 6, [7,8]]]]; console.log(arr.flat(Infinity)); // [1, 2, 3, 4, 5, 6, 7, 8] console.log(arr.join().split(',')); // [ 阅读全文
posted @ 2021-03-17 11:36 ltog 阅读(67) 评论(0) 推荐(0)
摘要:document.getElementById('copy').onclick = function () { let input = document.createElement('input'); input.setAttribute('id','input'); input.value = ' 阅读全文
posted @ 2021-03-12 18:36 ltog 阅读(67) 评论(0) 推荐(0)
摘要:1、含有多个条件的if语句 我们可以在数组中存储多个值,并且可以使用数组的 includes 方法。 //longhand if (x 'abc' || x 'def' || x 'ghi' || x 'jkl') { //logic } //shorthand if (['abc', 'def', 阅读全文
posted @ 2021-03-11 10:22 ltog 阅读(95) 评论(0) 推荐(0)
摘要:示例1:新旧节点不同 <template> <div id="app"> <hello-world :flag="flag" /> <button @click="toggle">toggle</button> </div> </template> <script> import HelloWorl 阅读全文
posted @ 2021-03-03 14:51 ltog 阅读(1454) 评论(0) 推荐(0)