背景
<style scoped>
.custom-alert {
height: 300px; /* 你想要设置的高度 */
overflow-y: auto;
}
</style>
解决方法
<style>
.custom-alert .el-message-box__message {
height: 300px; /* 你想要设置的高度 */
overflow-y: auto;
}
</style>
使用
this.$alert(response.msg, "导入结果", {
dangerouslyUseHTMLString: true,
customClass: 'custom-alert'
});