0
的行爲假設我有三個選項卡在一起,在每個選項卡的內容通過core-ajax
奇怪的聚合物數據伺機
<core-ajax auto url="http://example.com/tab.json" handleAs="json"
response="{{response}}"></core-ajax>
<paper-tabs id="tabs" selected="{{response[0].name}}" flex >
<template repeat="{{mytab as t}}">
<paper-tab name="{{t.name}}">{{t.name}}</paper-tab>
</template>
</paper-tabs>
Polymer({
responseChanged:function(response){
this.mytab= this.response;
console.log(this.mytab[0].name);
}
});
代碼獲取上述顯示正常,但什麼是困惑我的是,當我點擊其他除第一個選項卡外的兩個選項卡,第一個選項卡名稱(即內容)相應地改變爲哪個選項卡被點擊的名稱。我不能得到這個,任何人都可以向我解釋?
感謝
彭