想生成如下 html
<div>
<div>a</div>
<div>b</div>
</div>
<div>
<div>c</div>
<div>d</div>
</div>
<div>
<div>e</div>
</div>
以下代码应该如何修改?
<template v-for="(l,index) of lists">
<div>l.name</div>
</template>
1
ss098 2018-05-15 18:30:38 +08:00 1
|
2
niubee1 2018-05-15 18:35:07 +08:00
<template v-for="(l,index) of lists">
<template v-if="l % 2 === 0"> <div> </template> <div>l.name</div> <template v-if="l % 2 === 1"> </div> </template> </template> |
3
rabbbit 2018-05-15 18:39:54 +08:00
|
4
rabbbit 2018-05-15 18:44:13 +08:00
唔,我好像理解错了
|
5
rabbbit 2018-05-15 19:14:22 +08:00
|