前言:在ant中使用notification可能会有内容过多,需要换行展示,或者内容太多需要滚动
let message = info.file.response.message +'\n'
message += info.file.response.message +'\n'
this.$notification.error({
message: '文件导入失败',
description: message,
duration: null
});
在app.vue中加入样式
// 换行
.ant-notification{
white-space: pre-wrap !important;
}
// 滚动
.ant-notification-notice-description {
max-height: 90vh;
overflow-y: auto;
}