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
},
]