首先明确一点,antdv的notification组件如果需要换行,可使用ES6的 ` 符号+换行符,并且css设置whiteSpace: 'pre-wrap’属性,用于识别换行符/n,就可以实现换行效果。
具体代码如下:
定义弹出notification的方法:
openNotification(title, message) {
this.$notification.open({
message: title,
description: message,
onClick: () => {
},
style: {
//width: '600px',
whiteSpace: 'pre-wrap',
},
});
},
带换行的使用: