Open peipeichengbao opened 6 years ago
写一个页面模板,想绑定click方法,结果函数直接运行,并且没有绑定成功
<div class='coupon' onClick="{{clickFunction}}"> <span>Select Color and Size</span> </div>
var clickFunction=function(){ console.log('binding success') } var firstObj={ width:width+'px', height:width+'px', backgroundColor:'pink', clickFunction:clickFunction } var newFirstScreen=new XTemplate(firstScreenTemplate).render(firstObj); Node.all('#firstScreen').html(newFirstScreen);
写一个页面模板,想绑定click方法,结果函数直接运行,并且没有绑定成功