Skip to content

表达式的监听范围无效 #30

Description

@lucasyue

bind:expression on field
当field为集合时,集合对象调用insert或remove添加或删除对象时,未触发事件。仅在集合为空时会执行一次。
html代码如下:
<div id=\"orgUsersTable\"> <template name=\"operations\"> <div><div c-onclick=\"showUserRoleSet(user)\" c-bind=\"mappingUserRoleSet(user.roleSet) on user.roleSet\"></div></div></template></div>

js代码如下:
var roleSet = curUser.get("roleSet"); if(!roleSet){ roleSet = [{id:data,roleName:curRole.get('roleName'),systemName:curRole.get('systemName')}]; } else { roleSet.insert({id:data, roleName:curRole.get('roleName'),systemName:curRole.get('systemName')}); }
当roleSet为空时,触发了mappingUserRoleSet方法,渲染成功,其它时候均不再触发mappingUserRoleSet。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions