我有:
one = () => {
//do something
}
two = () => {
//do something
}
<div>
<button onClick={/*this.one, this.two (it doens't work)*/}>Go</button>
</div>
我如何仅使用一个onClick调用两个函数?
答案 0 :(得分:-1)
尝试:
<div>
<button onClick={this.one; this.two}>Go</button>
</div>
答案 1 :(得分:-1)
How to call multiple JavaScript functions in onclick event?
one = () => {
//do something
}
two = () => {
//do something
}
<div>
<button onclick="one();two();">Go</button>
</div>