我使用amp-bind和setState来更新https://beta.webfast.co/magma/collections-galaxy.html上不同样本的amp-img URLs。
然而,即使我正在更新特定的变量,如s0,还有其他的div正在更新,这并不是目的。
https://beta.webfast.co/magma/collections-galaxy.html
发布于 2020-06-12 05:00:45
结果表明,setState需要有一个默认值,添加:
<amp-img [src]="s0 || 'my_default_url'"></amp-img>帮助解决了这个问题。
https://stackoverflow.com/questions/62337281
复制相似问题