3
我正在嘗試使用ons-carousel的初始項目功能。我正在使用下面的代碼。當我嘗試放入並且ons-list和initial-index =「1」時,該項目向左偏移顯示另一個項目的條子。當我試圖將其滑回到正確的位置ons-carousel ons-list無法正確顯示initial-index =「1」
<section style="background-color: white">
<ons-list ng-repeat="task in tasks">
<ons-list-item modifier="chevron">
<ons-carousel initial-index="1" var="taskCarousel" swipeable="" auto-scroll="" style="width: 100%; height: 70px; color: black; background-color: #33cd5f">
<ons-carousel-item style="background-color: #33cd5f">
View #1 {{ task.descr }}
</ons-carousel-item>
<ons-carousel-item style="background-color: #5b2c7a">
View #2 {{ task.details }}
</ons-carousel-item>
</ons-carousel>
</ons-list-item>
</ons-list>
</section>
app.controller('TestController', function ($scope) {
$scope.tasks = [
{
id: "1",
descr: "Task Description #1",
details: "Details of Task #1"
},
{
id: "2",
descr: "Task Description #2",
details: "Details of Task #1"
},
{
id: "3",
descr: "Task Description #3",
details: "Details of Task #1"
},
{
id: "4",
descr: "Task Description #4",
details: "Details of Task #1"
}
];
});
哪個溫泉UI的版本,您使用的角度,所以我已經重複的元素? –
我正在使用v1.3.13 –