摘要: 1.在React中,由React控制的事件处理函数,如onClick, onChange等,setState是异步的 import React, { Component } from 'react'; export default class Input extends Component { co 阅读全文
posted @ 2021-06-03 16:55 Houqh95 阅读(150) 评论(0) 推荐(0)
摘要: 1.父传子:父组件通过props向子组件进行通信 父组件: import React from 'react' import Son from './son' export default class Parent extends React.Component{ constructor(props 阅读全文
posted @ 2021-06-02 14:59 Houqh95 阅读(60) 评论(0) 推荐(0)
摘要: 方法一:解决元素之间的空白符 <div class="parent"> <!-- 子元素写在同一行 --> <div class="child">child1</div><div class="child">child2</div> </div> 方法二:父元素设置font-size:0,子元素重设 阅读全文
posted @ 2021-04-01 15:43 Houqh95 阅读(88) 评论(0) 推荐(0)
摘要: overflow:hidden; text-overflow:ellipsis; white-space:nowrap; 阅读全文
posted @ 2020-07-11 17:26 Houqh95 阅读(810) 评论(0) 推荐(0)
摘要: html{ filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); } 阅读全文
posted @ 2020-07-11 17:14 Houqh95 阅读(297) 评论(0) 推荐(0)
摘要: .clearfix:before{ content: '', display: table; } .clearfix:after{ content: '', display: table; clear: both; } 上述clearfix在safari上会有1px的宽度 解决方法: 将displa 阅读全文
posted @ 2020-07-11 17:08 Houqh95 阅读(112) 评论(0) 推荐(0)