ant design vue使用collapse默认展开全部;自定义切换图标expandIcon

16 篇文章 0 订阅
15 篇文章 0 订阅

1,默认展开全部

在使用 ant-design-vue 的折叠面板 collapse 时候,如果key是数字的话,需要 String一下

<a-collapse v-model="activeKey" class="animateItem">
  <a-collapse-panel
    v-for="item of animateList"
    :header="item.name"
    :key="String(item.id)"
  >
  <a-row :gutter="16">
    <card-animate
      v-for="(value, index) in item.list"
      :key="index"
      :span="6"
      :animateName="value"
    />
    </a-row>
  </a-collapse-panel>
</a-collapse>

2,自定义切换图标

额(⊙o⊙)…,虽然我自定义的图标和官方上的几乎一样,但是自定义的是直角,是iconfont图标,官方的是锐角,老板说啥就是啥

<a-collapse v-model="activeKey" v-for="(section,sectionIndex) in sections" :key="String(sectionIndex)" :expand-icon-position="expandIconPosition" :bordered="false" class="customCollapse">
  <template slot="expandIcon" slot-scope="props">
    <div style="display:flex;justify-content:center" >
      <span style="opacity:0">{{props.isActive}}</span>
      <i v-if="props.isActive" class="iconfont icon-zhankai" style="font-size:18px"></i>
      <i v-if="!props.isActive" class="iconfont icon-shouqi" style="font-size:18px"></i>
    </div>
   </template>
   <a-collapse-panel :key="String(sectionIndex)" v-if="section.sectionName !== '总评'&&section.type !== 'evaluation'" :style="customStyle">
     <template slot="header">
       <div class="module">
         <p class="interview-drawer-con-title noBorder must-fill">
           <i class="iconfont icon-layer-group mr5"></i>
             {{section.sectionName}}
         </p>
        </div>
       </template>
       <div>内容内容内容</div>
     </a-collapse-panel>
    </a-collapse>  

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值