【发布时间】:2019-10-01 21:37:26
【问题描述】:
在 amp-bind Amp for Email 文档页面上,它显示了将 [src] 绑定到 amp-img 以更改图像源路径的示例(一个稍微复杂的示例):
<amp-state id="myAnimals">
<script type="application/json">
{
"dog": {
"imageUrl": "/img/dog.jpg",
"style": "greenBackground"
}
}
</script>
</amp-state>
<!-- Or change an image's src with the [src] binding. -->
<amp-img width="300" height="200" src="/img/dog.jpg"
[src]="myAnimals[currentAnimal].imageUrl">
</amp-img>
但是,当我在 Playground 中验证时,我得到: 属性“[src]”可能不会出现在标记“AMP-IMG (AMP4EMAIL)”中。
我正在尝试对 Carousel 组件 (type="slides") 执行类似操作,当我单击下一张/上一张幻灯片时,我希望更改电子邮件中其他位置的副本/图像。虽然我可以更改副本,但我似乎无法为图像做同样的事情。
是否无法使用 Amp for Email 的 amp-bind 组件更改图像源路径?有解决办法吗?
【问题讨论】: