React 中使用mui 框架 如何绑定tap事件
- Dominant language
- JavaScript
- Stars
- 13.5k
- Forks
- 6.5k
- PR merge metrics
- No merged PRs in 30d
Description
绑定tap事件后貌似无法阻止穿透现象
`class ShoppingList extends React.Component {
state = {shoppingList: [],count:0};
constructor(props) {
super(props);
window.fetch("http://private-62bc7-pc6.apiary-mock.com/fit_infos?city=1000001")
.then((response)=> {
return response.json()
})
.then((json)=> {
this.setState({shoppingList: json.datas})
})
.catch((ex)=> {
})
}
addCount=(e)=>{
e.preventDefault();
e.stopPropagation();
console.log(this)
};
render() {
return
- {item.c_name}
{this.state.shoppingList.map((item, index)=> {
return
})}
}
componentDidUpdate=()=>{
window.addEventListener('tap', this.addCount);
}
}`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.