Skip to content

kissy页面模板中能绑定方法吗? #746

@peipeichengbao

Description

@peipeichengbao

写一个页面模板,想绑定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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions