Weex中使用recycle-list组件,报Property or method "item" is not defined

发布于 2022-09-11 22:35:58 字数 2956 浏览 15 评论 0

问题描述

Weex中使用recycle-list组件,web页面上不展示,使用Playground预览时,IOS端也不能显示,但是安卓手机展示了,我尝试使用Weex官网上recycle-list组件的使用示例代码简单的文本列表显示没有报错,但是的复杂的列表展示也是出现同样的错误情况。

问题出现的环境背景及自己尝试过哪些方法

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

报错信息:

START WEEX VUE RENDER: 0.12.32, Build 2018-10-18 11:48.
webpack-internal:///31:6248 [Vue Render] install Vue 2.6.10.
webpack-internal:///27:620 [Vue warn]: Property or method "item" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/re...

found in

---> <PointsMallHome> at /Users/ljq/myweex-project/src/views/pointsMall/PointsMallHome.vue

   <WeexDiv>
     <Root>

warn @ webpack-internal:///27:620
webpack-internal:///27:620 [Vue warn]: Error in render: "TypeError: Cannot read property 'urls' of undefined"

found in

---> <PointsMallHome> at /Users/ljq/myweex-project/src/views/pointsMall/PointsMallHome.vue

   <WeexDiv>
     <Root>

warn @ webpack-internal:///27:620
webpack-internal:///27:1887 TypeError: Cannot read property 'urls' of undefined

at Proxy.render (webpack-internal:///147:23)
at VueComponent.Vue._render (webpack-internal:///27:3541)
at VueComponent.updateComponent (webpack-internal:///27:4059)
at Watcher.get (webpack-internal:///27:4472)
at new Watcher (webpack-internal:///27:4461)
at mountComponent (webpack-internal:///27:4066)
at VueComponent.Vue.$mount (webpack-internal:///27:8408)
at init (webpack-internal:///27:3117)
at createComponent (webpack-internal:///27:5971)
at createElm (webpack-internal:///27:5918)

logError @ webpack-internal:///27:1887
webpack-internal:///27:8421 Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-...
webpack-internal:///27:8432 You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deplo...

代码:

<template>

<recycle-list class="list" for="(item, index) in listData" switch="type" @loadmore="fetch">
    <cell-slot case="banner">
        <banner :img-urls="item.urls"/>
    </cell-slot>
    
    .....
    
    <cell-slot case="floor">
        <floor :title="item.title" :floor-info-list="item.floorInfoList"/>
    </cell-slot>
</recycle-list>

</template>

你期待的结果是什么?实际看到的错误信息又是什么?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文