AMP-html toggleVisibility 和 show actions 给出 "Target element does not support provided action" 错误

AMP-html toggleVisibility and show actions gives "Target element does not support provided action" errors

我发现很少有关于通过 Accelerated Mobile Pages 中的点击事件 show/hide/toggle 元素可见性的信息。 the docs as a global show/hide/toggleVisibility actions. There is also an example here中提到了如何使用它。

问题是它在当前状态下不起作用 - 至少对我而言。上面示例的简要测试(参见:https://plnkr.co/edit/CspuKe1I5LHTdHBWB3Cn?p=preview)给了我一堆 Action Error: Target element does not support provided action in [tap:normal-element.show] on [[object HTMLDivElement]] 错误。

我错过了什么吗?如何对 <div id="my-element">Hi</div>?

等元素使用全局 show/hide/toggleVisibility 操作

我在 GitHub 上发布了一个关于此的问题,有人友好地回复了我的问题:https://github.com/ampproject/amphtml/issues/8035

TL;DR 是在撰写本文时,具有这些功能的更新将在一周左右发布。