帖子
帖子
用户
博客
课程
显示全部楼层
79
帖子
3
勋章
803
Y币

[YonStudio] v-show 导致内容丢失

[复制链接]
发表于 2022-12-6 15:48:12
<view class="course-item" v-for="(item, index) in list">
      <view class="course-item-title" @click="openCourse(index)">
        <text class="course-title_text">{{ item.stageName }}</text>
        <image :class="stageArray[index] ? 'arrow_icons' : 'arrow_icon'" src="../../image/icon/arrow.png"></image>
      </view>

      <view v-show="stageArray[index]">
        <view class="course-item-stage" v-for="(_item, _index) in item.lists">
          <text class="course-title_text">{{ _item.name }}</text>
          <text>{{ _item.isFinish ? '已完成' : '未完成' }}</text>

          <view class="stage-options">
              <text class="stage-options_text">测试</text>
              <text class="stage-options_text">测试</text>
              <text class="stage-options_text">测试</text>
          </view>

        </view>
      </view>
    </view>


这是一段简易的代码 实现出来是一个折叠面板
第一次折叠没有问题,折叠第二个面板时,第一个面板内的{{ _item.name }}会消失,剩余元素还在






您好,我这边测试一下
79
帖子
3
勋章
803
Y币
技术咨询-特特 · 2022-12-6 16:01您好,我这边测试一下

嗯嗯 v-if 也不行 挺着急的
明天给我发个简单的测试代码,包括样式,可以复现你问题的,我这边测试一下
79
帖子
3
勋章
803
Y币
技术咨询-特特 · 2022-12-6 23:16明天给我发个简单的测试代码,包括样式,可以复现你问题的,我这边测试一下

解决了,因为 item-title 样式里有个 flex: 1; 去掉就可以了
42
帖子
2
勋章
459
Y币
贰山 · 2022-12-7 09:05解决了,因为 item-title 样式里有个 flex: 1; 去掉就可以了

666,我也是这个问题,flex:1,给我整半天
您需要登录后才可以回帖 登录

本版积分规则