cpp
<uni-collapse accordion v-model="accordionVal" @change="changeCollapse" ref="collapse">
<uni-collapse-item :title="index+1+'、'+item.productTitle" v-for="(item,index) in listData"
:key="index">
<view class="content">
<view class="text w100 gradeLi" v-for="(items,indexs) in item.children" :key="index+indexs" >
<view class="gradeLiTitle">{{index+1}}.{{indexs+1}}.{{items.gradeName}}</view>
<view class="gradeLiHg mt-2 flex">
<uni-data-checkbox @change="handleSelectHg($event,index,indexs)"
v-model="data.listData[index].children[indexs].checked"
:localdata="items.children" ></uni-data-checkbox>
</view>
<!-- 选择了不符合 -->
<view class="gradeLiHgNo w100 mt-2"
v-if="data.listData[index].children[indexs].checked==0">
<uni-easyinput type="textarea"
v-model="data.listData[index].children[indexs].wrongDescription"
placeholder="请输入不符合说明" />
<view class="w100 mt-2">
<uni-easyinput class="" type="textarea"
v-model="data.listData[index].children[indexs].rectificationMeasures"
placeholder="请输入整改措施" />
</view>
<view class="w100 mt-2">
<uni-easyinput v-model="data.listData[index].children[indexs].responsiblePerson"
placeholder="责任人" />
</view>
<view class="mt-2">
<my-upload-image
v-model="data.listData[index].children[indexs].supportingMaterials"
:limit="5" :index="index" :indexs="indexs"
@dataToParent="handleDataFromChild"></my-upload-image>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
cpp
import {
ref,
onMounted,
reactive,
getCurrentInstance,
onBeforeMount,
toRefs
} from 'vue'
const {
proxy
} = getCurrentInstance();
cpp
//选择符号不符合
const handleSelectHg = ((e, index, indexs) => {
data.listData[index].children[indexs].checked = e.detail.value;
console.log("您选择了", data.listData[index].children[indexs].checked)
// 选择了不符号之后去延时刷新高度
handleHeight();
})
//解决超出不显示问题
const handleHeight=(() => {
proxy.$nextTick(() => {
setTimeout(() => {
console.log("1233")
proxy.$refs.collapse.resize();
}, 100)
});
})
这是一个巨坑
如果是vue2.0 把proxy改为this即可