4***@qq.com
4***@qq.com
  • 发布:2019-05-07 00:24
  • 更新:2019-05-07 00:58
  • 阅读:1839

uni-collapse v-for 无法展开uni-collapse-item 报错

分类:uni-app

1 代码如下

<uni-collapse  accordion="true" >  
                            <block v-for="(work,index2) in sys.WorkTypes" :key="index2">  
                                <uni-collapse-item :title="work.WorkTypeName">  
                                    <view class="work-content">  
                                        <view class="work-content-item" v-for="job in work.Jobs" :key="job.Id">  
                                            <view class="header">  
                                                <view class="name">{{job.UserName}}</view>  
                                                <view class="action">  
                                                    <view class="icon">  
                                                        <uni-icon type="compose" size="18" @click="$goto('site/site-manage/create', 'siteId='+siteId+'&id='+job.JobRecordId+'&type='+type)"></uni-icon>  
                                                    </view>  
                                                    <view class="icon">  
                                                        <uni-icon type="trash" size="18" @click="removeWorkRecord(job)"></uni-icon>  
                                                    </view>  
                                                </view>  
                                            </view>  
                                            <view class="body">  
                                                <view class="detail-item">  
                                                    <view class="label">时间</view>  
                                                    <view class="value">{{job.StartTime}} ~ {{job.EndTime}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">周期</view>  
                                                    <view class="value">{{job.FrequencyTpName}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">频次</view>  
                                                    <view class="value">{{job.Frequency}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">星期</view>  
                                                    <view class="value weeks">  
                                                        <view class="week" v-for="week in job.Weeks" :key="week.Id">{{week.WeekName}}</view>  
                                                    </view>  
                                                </view>  
                                            </view>  
                                        </view>  
                                </view>  
                                </uni-collapse-item>  
                            </block>  
                        </uni-collapse>   

2 环境
1.9.5.20190505-alpha
3 配置 片段
"app-plus" : {
"usingComponents": true,

"mp-weixin" : {
/ 小程序特有相关 /
"appid" : "",
"setting" : {
"urlCheck" : true
},
"usingComponents":true
},

4 错误信息

5 已经尝试删除过\unpackage 目录 项目是老版本编译器建的

2019-05-07 00:24 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com (作者)

<block v-for="(sys,index) in sysJobCont" :key="index">  
                        <view class="uni-title ">  
                            <text class="font-icon uni-color-blue">&#xe625;</text>  
                            {{sys.SubSystemName}}  
                        </view>  
                        <uni-collapse  accordion="true" >  
                            <block v-for="(work,index2) in sys.WorkTypes" :key="index2">  
                                <uni-collapse-item :title="work.WorkTypeName">  
                                    <view class="work-content">  
                                        <view class="work-content-item" v-for="job in work.Jobs" :key="job.Id">  
                                            <view class="header">  
                                                <view class="name">{{job.UserName}}</view>  
                                                <view class="action">  
                                                    <view class="icon">  
                                                        <uni-icon type="compose" size="18" @click="$goto('site/site-manage/create', 'siteId='+siteId+'&id='+job.JobRecordId+'&type='+type)"></uni-icon>  
                                                    </view>  
                                                    <view class="icon">  
                                                        <uni-icon type="trash" size="18" @click="removeWorkRecord(job)"></uni-icon>  
                                                    </view>  
                                                </view>  
                                            </view>  
                                            <view class="body">  
                                                <view class="detail-item">  
                                                    <view class="label">时间</view>  
                                                    <view class="value">{{job.StartTime}} ~ {{job.EndTime}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">周期</view>  
                                                    <view class="value">{{job.FrequencyTpName}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">频次</view>  
                                                    <view class="value">{{job.Frequency}}</view>  
                                                </view>  
                                                <view class="detail-item">  
                                                    <view class="label">星期</view>  
                                                    <view class="value weeks">  
                                                        <view class="week" v-for="week in job.Weeks" :key="week.Id">{{week.WeekName}}</view>  
                                                    </view>  
                                                </view>  
                                            </view>  
                                        </view>  
                                </view>  
                                </uni-collapse-item>  
                            </block>  
                        </uni-collapse>   
                    </block>
DCloud_heavensoft

DCloud_heavensoft

注意看折叠面板的文档,里面说的很清楚,要用v-for需要用自定义组件模式

  • 4***@qq.com (作者)

    问题已经解决 不是配置自定义组件的问题,我已经配置了,问题上写了!谢谢官方回复! 问题出在本地的组件版本问题,更新组件版本就不会了。

    2019-05-07 09:48

  • x***@163.com

    回复 4***@qq.com: 重新下载组件就可以用v-for了么?为什么我还不行?

    2020-07-09 10:52

该问题目前已经被锁定, 无法添加新回复