gpt4 book ai didi

polymer - Polymer 中的模板数据绑定(bind)中的 {{}} 和 [[]] 有什么区别?

转载 作者:行者123 更新时间:2023-12-04 18:30:25 26 4
gpt4 key购买 nike

我有时会遇到{{}}语法,有时 [[]]模板数据绑定(bind) .我很确定[[]]用法,它是指组件中的属性,但是{{}}做?

最佳答案

来自 https://www.polymer-project.org/1.0/docs/devguide/data-binding

Binding annotation Text surrounded by double curly bracket ({{ }}) or double square bracket ([[ ]]) delimiters. Identifies the host data being bound. Compound binding A string literal containing one or more binding annotations.

Whether data flow goes down from host to target, up from target to host, or both ways is controlled by the type of binding annotation and the configuration of the target property.

  • Double-curly brackets (}) support both upward and downward data flow.

  • Double square brackets ([[ ]]) are one-way, and support only only downward data flow.

关于polymer - Polymer 中的模板数据绑定(bind)中的 {{}} 和 [[]] 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39365410/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com