摘要: const person = { name: "Bill", age: 19, city: "Seattle" }; let myString = JSON.stringify(person); 阅读全文
posted @ 2022-05-21 23:22 锦呀 阅读(24) 评论(0) 推荐(0)
摘要: const person = { name: "Bill", age: 19, city: "Seattle" }; const myArray = Object.values(person); 阅读全文
posted @ 2022-05-21 23:20 锦呀 阅读(22) 评论(0) 推荐(0)
摘要: for in 用法 比如一个对象person={ name:"lwj", age:18, citiy:"xiannning" }; for (let x in person){ x代表属性名 输出属性值是person[x],不能用person.x 阅读全文
posted @ 2022-05-21 23:19 锦呀 阅读(30) 评论(0) 推荐(0)
摘要: let arr1 = [1,2,3]; let arr2 = [4,5,6]; let arr = arr1.concat(arr2);//arr = [1,2,3,4,5,6]; arr1.push(arr2); console.log(arr1);输出 [1,2,3,[4,5,6]] 但是开始我 阅读全文
posted @ 2022-05-16 21:31 锦呀 阅读(24) 评论(0) 推荐(0)
摘要: innerHTML与innerText区别 前者渲染并不显示标签,后者不渲染但是显示所有内容 <h1>我是一朵花</h1> js输出方式:window.alert() innerHTML document.write() console.log js类型运算符 typeof (返回变量的类型) in 阅读全文
posted @ 2022-05-15 23:08 锦呀 阅读(292) 评论(0) 推荐(0)
摘要: var arr = new Array(3); ...① arr[0] = 1; arr.b = 0; console.log(arr.length); ...② arr.forEach(value=>{ console.log(value); ...③ }) for(var i in arr){ 阅读全文
posted @ 2022-05-15 16:41 锦呀 阅读(30) 评论(0) 推荐(0)
摘要: var uname = "window"; var object = { uname :"object", fun:function(){ console.log(this.uname); return function(){ console.log(this.uname); } } } objec 阅读全文
posted @ 2022-05-10 17:43 锦呀 阅读(29) 评论(0) 推荐(0)
摘要: 当切换组件要保持数据的及时变换时,用keep-alive <div v-for="(component,index) of components" :key="index" :class="{active:component.name==currentComponent}" @click="curr 阅读全文
posted @ 2022-05-02 14:30 锦呀 阅读(85) 评论(0) 推荐(0)
摘要: ↑ 快速打出上次命令 tab键补全命令 esc键,快速清空命令 输入cls命令,可以清空终端 __dirname表示当前文件所处的目录,不会因为切换不同位置而影响 路径拼接 path.join('/a','/b/c','/d','e') path.basename()获取路径中的文件名 (path, 阅读全文
posted @ 2022-02-13 22:07 锦呀 阅读(38) 评论(0) 推荐(0)