01 2021 档案

摘要:1.babel会将jsx转换为React.creatElement表达式; 2.React.createElement render(){ return element } 在render函数调用时,生成一个element(虚拟节点); 3.众多element组成虚拟dom; 4.ReactDOMC 阅读全文
posted @ 2021-01-29 09:50 helloSWZ 阅读(203) 评论(0) 推荐(0) 编辑
摘要:通过params 1.路由表中 <Route path=' /sort/:id ' component={Sort}></Route> 2.Link处 HTML方式 <Link to={ ' /sort/ ' + ' 2 ' } activeClassName='active'>XXXX</Link 阅读全文
posted @ 2021-01-22 15:40 helloSWZ 阅读(172) 评论(0) 推荐(0) 编辑
摘要:1.jQuery ajax $.ajax({ type: 'POST', url: url, data: data, dataType: dataType, success: function () {}, error: function () {} }); 传统 Ajax 指的是 XMLHttpR 阅读全文
posted @ 2021-01-22 15:36 helloSWZ 阅读(128) 评论(0) 推荐(0) 编辑
摘要:###浅拷贝 //用=赋值 var a = {name:'hello'}; var b = a; b.name="world"; console.log(a.name); // 只复制第一层的浅拷贝 function simpleCopy(obj1) { var obj2 = Array.isArr 阅读全文
posted @ 2021-01-14 17:53 helloSWZ 阅读(138) 评论(0) 推荐(0) 编辑
摘要:px:像素单位; em:相对于父元素大小; rem:相对于根元素大小; vw:视口的最大宽度,1vw=视口宽度的百分之一; vh:视口得最大高度,1vh=视口高度的百分之一; vm:相对于视口的宽度或高度中较小的那个. 阅读全文
posted @ 2021-01-14 16:06 helloSWZ 阅读(225) 评论(0) 推荐(0) 编辑
摘要:###1.基本语法 /*less*/ h1{ color:red; } /*sass*/ a color:red /* stylus */ h1 { color: #0982C1; } h1 color: #0982C1; h1 color #0982C1 ###2.变量 Less css中变量都是 阅读全文
posted @ 2021-01-11 17:24 helloSWZ 阅读(160) 评论(0) 推荐(0) 编辑
摘要:###1.编写方式 let xx = item ⇒item 单条语句可以省略return和{},单个参数可以省略() ###2.箭头函数不能作为构造函数 let A=()=>{}; let a = new A();报错 function A(){}; let a = new A();不报错 ###3 阅读全文
posted @ 2021-01-11 15:43 helloSWZ 阅读(120) 评论(0) 推荐(0) 编辑
摘要:###同源策略 协议+域名+端口 相同 ###解决方案 1.jsonp解决跨域 2.nginx代理 3.中间件proxy 4.WebSocket 5.PostMessage 6.CORS 服务端设置Access-Control-Allow-Origin,若需要带cookie,前后端都需要设置 阅读全文
posted @ 2021-01-04 17:15 helloSWZ 阅读(130) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示