[background: url({{XXX}}) no-repeat center center 在严格模式下不允许对只读属性赋值
Assignment to read-only properties is not allowed in strict mode in [background: url({{XXX}}) no-repeat center center
我在 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>
这就是我的工作方式
<div class="container-fluid project_img" attr.style.background="url({{_project.images.web}}) no-repeat center center;">
我在 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>
这就是我的工作方式
<div class="container-fluid project_img" attr.style.background="url({{_project.images.web}}) no-repeat center center;">