[ 
https://issues.apache.org/jira/browse/WEEX-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16456035#comment-16456035
 ] 

Hanks Zhang commented on WEEX-310:
----------------------------------

You can't use the "outer" data which are not defined in the list data. That 
means you can only use the data of the `list` property within the <cell-slot> 
for your case. It's a limitation of recycle-list, I'll add a notice in the 
document. The best solution for this case is putting all data is the `list`, 
it's also a good practice.

 

recycle-list 只能用写在 for 里的数据,“外层”属性不能用,这算是个底层功能的限制。建议把数据都放 list 里。

> recycle-list无法访问外层属性
> --------------------
>
>                 Key: WEEX-310
>                 URL: https://issues.apache.org/jira/browse/WEEX-310
>             Project: Weex
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 0.18
>            Reporter: mhl
>            Assignee: Adam Feng
>            Priority: Blocker
>              Labels: recycle-list
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
>  
> {code:java}
> <template>
>   <recycle-list for="(item, index) in list" @loadmore="loadMoreData"
> loadmoreoffset="10">
>     <cell-slot>
>        <div>
>          <text>{{curIndex}}</text>
>          <slider interval="3000" auto-play="true" infinite="true">
>              <div class="frame" v-for="img in imgList">
>                  <image class="image" :src="img.src"></image>
>                  <text class="title" >{{img.title}}</text>
>              </div>
>          </slider>
>       </div>
>    </cell-slot>
>   </recycle-list>
> </template>
> <script>
> export default {
>    name: 'find',
>    data() {
>       return {
>         curIndex: 0,
>         imageList: [
>           {title: 'item A', src: 
> 'http://img1.gtimg.com/ent/pics/hv1/122/43/2273/147812912.jpg'},
>           {title: 'item B', src: 
> 'http://img1.gtimg.com/ent/pics/hv1/122/43/2273/147812912.jpg'},
>           {title: 'item C', src: 
> 'http://img1.gtimg.com/ent/pics/hv1/122/43/2273/147812912.jpg'}
>        ],
>        list: [1,2,3]
>     }
>    }
> }
> </script>{code}
> 在recycle-list里面无法访问外层属性,比如无法访问:curIndex / imageList 。  recycle-list只能访问list。 
> 这应该是bug , 换成list组件是可以正常访问的。
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to