Ant_vue 组件使用记录

1.弹窗次数限制提示只出现一次

注意:
使用前先进行销毁,即可控制显示次数;
配置–message.config{maxCount:3} //最大显示数;
销毁以notification为例;

 context.$notification.destroy()
 context.$notification.error({
     message: '出错',
     description: '服务器异常',
     duration: 5
  })

表格中表头自定义排序

需求是自定义排序事件,表格中的@change事件,分页也会触发每一次排序造成数据乱序;
解决方案:自定义表头,单独绑定事件

//视图层主要代码
 <a-table
  :columns="columns"
  :data-source="data"
  :pagination="paginationP"
 >
 ...
  <template slot="customTitle" 
            >创建时间
            <a-icon
              @click="handleTableChange('creationTimestamp')"
              :type="
                queryField.sortBy.startsWith('d')
                  ? 'sort-ascending'
                  : 'sort-descending'
              "
              style="color: #1890ff; padding: 0 8px"
          /></template>
</a-table>

//数据层主要代码
const columns = [
 {
    slots: { title: 'customTitle' },//这个来修改表头,绑定点击事件,秒啊!!
    scopedSlots: {
      customRender: 'creationTime'
    },
    width: 180
  },
]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值