2015-08-27 40 views
1

我試圖讓在各列表項轉盤的列表,這是我做的溫泉的UI轉盤

<ons-list id ="list" style="padding:0px;" ng-controller="ItemController"> 

    <ons-list-item ng-repeat="item in local" style="padding:0;"> 
     <ons-carousel swipeable initial-index="0" style="height: 100%;width: 100 %;position: absolute;"> 
     <ons-carousel-item style="padding:0;"> 
      <ons-button modifier = "quiet" ng-click="menu.close();customSetMainPage(item.id);"> 
      {{item.name}} 
      </ons-button> 
     </ons-carousel-item> 
     <ons-carousel-item> 
      <ons-button ng-click="deletepresentation(item.id);local.splice($index, 1);"> 
       Remove 
       <ons-icon icon="ion-trash-a"/> 
      </ons-button> 
     </ons-carousel-item> 
     </ons-carousel> 
    </ons-list-item> 


    </ons-list> 

現在列表中工作,但是當顯示第一次它表明這樣的:

enter image description here

時,它應該是這樣的:enter image description here

和添加項目到列表中後,它顯示了第二輪播項目,而不是第一:

enter image description here

任何幫助嗎?

回答

0

旋轉木馬在先前版本中有一些與您的第一個問題有關的錯誤,所以如果您尚未使用它,我建議您更新到最新的Onsen UI。

此外,您需要將實際刪除之前要刪除的項目還原到其初始索引。最好將auto-refreshauto-scroll屬性添加到輪播。

在這裏工作:http://codepen.io/frankdiox/pen/wKwpGZ

希望它幫助。