
- 发布:2020-06-03 09:57
- 更新:2020-07-09 08:42
- 阅读:1140
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Win10 1903
HBuilderX类型: 正式
HBuilderX版本号: 2.7.9
手机系统: 全部
手机厂商: 华为
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
<template>
<view>
<uni-collapse ref='reColl' accordion="true">
<scroll-view :scroll-into-view="scrollViewId" :style="{ height: winHeight + 'px' }" class="uni-indexed__list"
scroll-y="true">
<uni-collapse>
<uni-collapse-item @click="openIndex=index" v-for="(yearlist,index) in list" :key="index" :title="yearlist.year + '款' " :show-animation="true">
<uni-list>
<uni-list-item style="padding-left:5px;" v-for="(item,idx) in yearlist.data" :key="idx" :title="item.name" :show-arrow="false"
@click="selected(item)"></uni-list-item>
</uni-list>
</uni-collapse-item>
</uni-collapse>
</scroll-view>
</uni-collapse>
</view>
</template>
onLoad(option) {
this.winHeight = uni.getSystemInfoSync().windowHeight
this.carimg = option.img
this.data.series_id = option.id
let obj = []
getbrandInfoApi({ ...this.data}).then(res => {
res.data.info.filter(item => {
let data = item['year']
let index = obj.findIndex(idx => {
return (idx.year == data) ? true : false
})
if (-1 == index) {
obj.push({ year: data, data: [{ 'name':item['name'],'full_name':item['full_name'],'group_name':item['group_name'],'id':item['id']}]})
} else {
obj[index].data.push({'name':item['name'],'full_name':item['full_name'],'group_name':item['group_name'],'id':item['id']})
}
})
this.list = obj
}).catch(err => {
console.log(err)
})
},
<template>
<view>
<uni-collapse ref='reColl' accordion="true">
<scroll-view :scroll-into-view="scrollViewId" :style="{ height: winHeight + 'px' }" class="uni-indexed__list"
scroll-y="true">
<uni-collapse>
<uni-collapse-item @click="openIndex=index" v-for="(yearlist,index) in list" :key="index" :title="yearlist.year + '款' " :show-animation="true">
<uni-list>
<uni-list-item style="padding-left:5px;" v-for="(item,idx) in yearlist.data" :key="idx" :title="item.name" :show-arrow="false"
@click="selected(item)"></uni-list-item>
</uni-list>
</uni-collapse-item>
</uni-collapse>
</scroll-view>
</uni-collapse>
</view>
</template>
onLoad(option) {
this.winHeight = uni.getSystemInfoSync().windowHeight
this.carimg = option.img
this.data.series_id = option.id
let obj = []
getbrandInfoApi({ ...this.data}).then(res => {
res.data.info.filter(item => {
let data = item['year']
let index = obj.findIndex(idx => {
return (idx.year == data) ? true : false
})
if (-1 == index) {
obj.push({ year: data, data: [{ 'name':item['name'],'full_name':item['full_name'],'group_name':item['group_name'],'id':item['id']}]})
} else {
obj[index].data.push({'name':item['name'],'full_name':item['full_name'],'group_name':item['group_name'],'id':item['id']})
}
})
this.list = obj
}).catch(err => {
console.log(err)
})
},
操作步骤:
直接打开就不显示
直接打开就不显示
预期结果:
修复bug 显示title
修复bug 显示title
实际结果:
APP页面 uni-collapse-item title 显示 undefined
APP页面 uni-collapse-item title 显示 undefined
bug描述:
uni-collapse uni-collapse-item报BUG
uni-collapse-item title 属性设置了,但是页面显示 undefined
2***@qq.com
大哥 你解决了吗
2023-03-10 08:36