vue,react点击执行多个函数

HTML

Vue:<button type=“button” @click=“a();b()”>vue按钮
React:<button type=“button” onClick={function(event){ a(); b()}}>react按钮
听说现在比较流行ES6?
React:<button type=“button” onClick={(event) => { a(); b();}}>react按钮


js

methods:{
a(){
console.log(‘a’);
},
b(){
console.log(‘b’);
}
}

原作者:非凡主力
来源:CSDN
原文:https://blog.csdn.net/feifanzhuli/article/details/78092715
版权声明:本文为博主原创文章,转载请附上博文链接!

发布了33 篇原创文章 · 获赞 9 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_22188085/article/details/86621315