Polymer Javascript Dom-Repeat Button Group Issue

时间:2017-06-08 16:52:58

标签: javascript dom polymer polymer-1.0 dom-repeat

我对Polymer比较新,我正在尝试创建一个按钮组,其按钮对应于属性数组中的每个条目。这是我到目前为止的代码:

<div class="btn-group">
           <template is="dom-repeat" items="{{floorCount}}">
             <input id="button-[[index]]" name="btn-group" type="radio">
             <label style="width:[[getLevelButtonWidth(floorCount)]]% !important;" for="button-[[index]]" class="btn">[[item]]</label>
           </template>
           <input id="idAll" name="btn-group"  type="radio">
           <label style="width:[[getLevelButtonWidth(floorCount)]]% !important;" for="idAll" class="btn">All</label>
         </div>
         
         

楼面数属性已包含在下方。

floorCount:{
      type: Array,
      value: function(){
        return ["1"];
      }
    }

问题在于它正确创建了每个按钮,但由于某种原因,您只能单击组中的“idAll”按钮。这种dom-repeat和绑定在某种程度上打破了该组的功能。任何帮助将不胜感激,谢谢!

1 个答案:

答案 0 :(得分:0)

当写入html默认属性时,Polymer也不喜欢在属性中$sellPrice = $client->getSellPrice('BTC-USD'); $amount=$sellPrice->getAmount(); $currency=$sellPrice->getCurrency(); 连接字符串。添加$,对于样式属性也是如此。