2016-08-05 70 views
0

我使用onsen-ui的反应版本。有没有一种好的方法可以将列表添加到另一个列表中?我正在寻找类似jQueryMobile的可折叠/手风琴列表。如何添加一个列表到onsen-ui的另一个列表?

+1

我看你已经回答了你自己[这里](https://community.onsen.io/topic/599/lists-inside-other-lists)。正如你所看到的,将列表嵌套在一起是没有问题的。至于可折叠等,我想可以用几行css/js来完成。 :) –

+0

非常感谢!我会在这里为未来的用户发布答案;) – Lifz

回答

0

万一别人好奇,实际上并不是什么大事。

的伪代码(注意,父ListItem没有tappable):

<List 
    <ListItem> 
    Category name 
    <List className="childList" 
     <ListItem tappable>Item name</ListItem> 
    /> 
> 

的CSS:

.list.childList { 
    width: 100%; 
    border: 0; 
} 

它看起来像这样在Android: 0_1470422427007_upload-6933bd34-2ea3-4d2c-bc29-5d6dc4dac548

它在iOS上看起来像这样: 0_1470422598421_upload-e131afcf-50d5-4417-8421-d560a911e8ea

相关问题