我在 Edge 中收到此错误,但在 chrome 中一切正常 无法理解这里出了什么问题......
<div class="container-fluid project_img" style="background: url({{_project.images.web}}) no-repeat center center;">
</div>
Microsoft Edge 中的错误:
Assignment to read-only properties is not allowed in strict mode in [background: url({{_project.images.web}}) no-repeat center center; in ProjectDetailComponent
最佳答案
使用代替
<div class="container-fluid project_img" [style.background]="'url(' + _project.images.web + ') no-repeat center center;'">
</div>
关于javascript - [背景 : url({{XXX}}) no-repeat center center] 中的严格模式下不允许分配给只读属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36198547/