介绍下背景:本身是VUE开发,但公司有React 项目,现在对已有的React项目的添加一些新功能
1、元素class 写法
我正常写了class=“index” ESlint 报错 说需要使用className=“index”
不知道是react 需要这么写还是 ESlint限制的
2、点击事件 click
<div onClick="{handleClick}">aaaaa</div>
3、路由跳转
this.props.history.push('/index')
4、获取路由信息(URL信息)
this.props.location
this.props.location.pathname
this.props.location.search