const横幅动画={ 属性:0, 步骤:[ 函数one(){ this.property=this.helperFunction(); }, 函数two(){ console.log(this); } ], 帮助程序函数(){ //做一些计算并返回结果 返回1; }, doSteps(steps=this.steps){ 步骤.forEach(步骤=>{ setTimeout(步骤,100); }); } }; bannerAnimation.doSteps();
-
1 这回答了你的问题吗? 如何在回调中访问正确的“this”? – 进化xbox 评论 2020年1月21日11:08