0
添加項目旋轉木馬我有這樣創建數組: var thecharts = new Array(chartg, chartb);
煎茶:我如何使用數組
在我看來,我有一個轉盤和轉盤的項目將被陣列確定thecharts
代碼如下所示:
items: [
{
xtype: 'carousel',
width: '90%',
height: '70%',
defaults: {
styleHtmlContent:true,
id: 'carousel'
},
items: [
thecharts[0],
thecharts[1]
]
},
這樣很好。但是,數組的大小可能會根據其他標準而變化。因此,我寧可不使用索引,只是整個數組拖放到items
並讓它看起來像這樣:
items: [ thecharts ]
我嘗試了這種方式,但它只是在數組中返回的第一個元素。我如何獲得它返回數組中的所有元素?