let count = 0;
class App extends Component {
onClick = () => {
count += 1;
setTimeout(() => {
if (count === 1) {
console.log('single click: ', count);
} else if (count === 2) {
console.log('setTimeout onDoubleClick: ', count);
}
count = 0;
}, 300);
}
render(){
return (...)
}
}
网友评论