qiankun模式下,子应用的样式不生效:
问题如下:
主应用严格模式下,在主应用跳转到子应用,子应用组件的样式没有生效
解决方式:
在主应用的入口文件动态注入没有生效的样式
例如:
// 动态注入子应用的样式
import subCommonStyle from "@/utils/styleCommon";
document.head.insertAdjacentHTML('beforeend', `<style>${subCommonStyle}</style>`);
styleCommon
const subCommonStyle = `
.log-dialog {
text-align: center;
.content {
color: #606266;
line-height: 18px;
.info {
margin-top: 15px;
font-weight: 600;
}
.el-icon-warning {
margin-right: 4px;
font-size: 45px;
color: #ff8e14;
}
}
}
`;
export default subCommonStyle;
然年后在操作页面,样式就生效了