机器人
AI摘要
WXZGPT
生成中...
It has been 505 days since the last update, the content of the article may be outdated.

问题描述

在 uView 折叠面板中使用 v-if 来控制内容的显示隐藏时,会出现高度不对的问题

解决办法

  • 使用 uView 官方推荐的 init() 方法来初始化折叠面板
js
1
2
3
this.$nextTick(() => {
this.$refs.collapseHeight.init()
})
  • 直接修改折叠面板的样式
css
1
2
3
/deep/ .u-collapse-item__content {
height: auto !important;
}