摘要: (一)父组件向子组件传值: 父组件向子组件传递内容,靠属性的形式传递。 {/*父组件*/}import React,{Component,Fragment} from 'react' import Item from './item' import './style.css' class ItemL 阅读全文
posted @ 2019-11-19 09:57 林玖女神 阅读(462) 评论(0) 推荐(0) 编辑
摘要: Vscode插件搜索Simple React Snippets,点击安装,即可使用,常用快捷键如下: (二) 简单举例如下: imr - Import React import React from 'react'; imrc - Import React, Component import Rea 阅读全文
posted @ 2019-11-18 16:23 林玖女神 阅读(849) 评论(0) 推荐(0) 编辑
摘要: 函数防抖:将几次操作合并为一次操作进行。原理是维护一个计时器,规定在delay时间后触发函数,但是在delay时间内再次触发的话,就会取消之前的计时器而重新设置。这样一来,只有最后一次操作能被触发。 函数节流:使得一定时间内只触发一次函数。原理是通过判断是否到达一定时间来触发函数。 相同之处:解决频 阅读全文
posted @ 2019-11-15 17:08 林玖女神 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 摘自:https://www.cnblogs.com/theblogs/p/10328514.html 摘自:https://www.jianshu.com/p/1749766fd97a 摘自:https://blog.csdn.net/qq_34123985/article/details/905 阅读全文
posted @ 2019-11-13 17:06 林玖女神 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1.伪类清除浮动: .clear::after{ content: ""; display: block; clear: both; visibility: hidden; height: 0; } .clear::after{ zoom: 1; } 2. 对于父元素固定高度,子元素浮动,则可以使用 阅读全文
posted @ 2019-11-13 16:51 林玖女神 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 1.单行文本溢出变略号 overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 2.多行文本溢出变省略号 overflow:hidden;text-overflow:ellipsis; display:-webkit-box; - 阅读全文
posted @ 2019-11-13 16:45 林玖女神 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1.先画一个正方形,启发一下如何画上三角、下三角、左三角以及右三角。 <div class="square"></div> .square{ width: 0; height: 0; border-width: 100px; border-style: solid; border-color:#FF 阅读全文
posted @ 2019-11-13 16:20 林玖女神 阅读(206) 评论(0) 推荐(0) 编辑
摘要: (一)apply()和call()的区别 apply接受两个参数,第一个参数指定了函数体内this对象的指向,第二个参数为一个带下标的集合,这个集合可以为数组,也可以为类数组, apply方法把这个集合中的元素作为参数传递给被调用的函数。 let func = function(a,b,c){ co 阅读全文
posted @ 2019-11-13 15:37 林玖女神 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 原文摘自:https://www.cnblogs.com/gwf93/p/10384352.html 先写一个父类Car function Car(name){ this.name = name; this.driver = function (){ console.log('日行千里') } } 阅读全文
posted @ 2019-11-13 11:44 林玖女神 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 灵活运用css开发技巧摘自: https://juejin.im/post/5d4d0ec651882549594e7293 灵活运用js开发技巧摘自:https://juejin.im/post/5cc7afdde51d456e671c7e48#heading-72 灵活运用PS切图技巧摘自:ht 阅读全文
posted @ 2019-11-11 14:29 林玖女神 阅读(141) 评论(0) 推荐(0) 编辑