Salesforce Lightning {!expression}和{#expression}的区别

来源:互联网 发布:男朋友短细的体验知乎 编辑:程序博客网 时间:2024/05/20 05:59
  • {#expression} (Unbound Expressions)
    Data updates behave as you would expect in JavaScript. Primitives, such as String , are passed by value, and data updates for the
    expression in the parent and child are decoupled.
    Objects, such as Array or Map , are passed by reference, so changes to the data in the child propagate to the parent. However,
    change handlers in the parent aren’t notified. The same behavior applies for changes in the parent propagating to the child.

  • {!expression} (Bound Expressions)
    Data updates in either component are reflected through bidirectional data binding in both components. Similarly, change handlers
    are triggered in both the parent and child components.

原创粉丝点击