ZBLOG

为了在编辑模式下完全隐藏整个 <div class="loanInfo">,你可以在 <div>v-if 指令中加入 !isEditing 的条件判断。这是一个简单的实现方式,可以根据你的需求进行调整。下面是修改后的代码:

  1. <div
  2. class="loanInfo"
  3. v-if="isCustomerNotFound && productRows.length > 0 && !isEditing"
  4. :style="{ height: '100px' }"
  5. >
  6. <a-row v-for="(item, index) in productRows" :key="index">
  7. <a-col :span="12">
  8. <a-form-item label="产品名称" style="width: 101%">
  9. <a-input v-model:value="item.productName" />
  10. </a-form-item>
  11. </a-col>
  12. <a-col :span="12">
  13. <a-form-item label="借据号" style="width: 102%; margin-left: -5px">
  14. <a-input v-model:value="item.loanInfoCode[index]" />
  15. </a-form-item>
  16. </a-col>
  17. </a-row>
  18. <span
  19. v-if="productRows.length > 0"
  20. class="jiahao"
  21. @click="addProductRow"
  22. >
  23. +
  24. </span>
  25. </div>

改动说明:

  1. 使用 v-if:在 <div> 上添加了 v-if 条件,使其仅在满足 isCustomerNotFoundproductRows.length > 0!isEditing 的情况下显示。
  2. 去掉不必要的条件:移除了各个 <a-col> 内部的 v-if, 因为整个 div 已经用一个条件进行控制。

这样,当 isEditing 为 true 时,整个贷款信息部分将不会被渲染。希望这个解决方案能满足你的需求!如果还有其他问题,请随时告知!


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=22862

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?