uniapp使用uview组件的Collapse 折叠面板,动态渲染之后计算面板的高度
在uniapp里会有使用uview的Collapse折叠面板的情况,但在动态渲染数据之后,面板的内容会显示不全,这时候可以使用ref来重新获取高度;
<u-collapse ref="collapseView">
<u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index">
{{item.body}}
</u-collapse-item>
</u-collapse>
that.$nextTick(() => {
that.$refs.collapseView.init()
})
在数据请求之后,通过$ref来重新获取Collapse的高度;