有没有一种方法可以在 amp 故事中创建用户交互内容?

Is there a way we can create user interactive content within amp stories?

我正在构建一个 amp 故事,我需要将用户输入作为选择。假设有 3 个按钮 Button 1Button 2Button 3。如果用户单击 Button 1,将显示 choice 1 的内容,其他按钮的内容也类似。

我试图为此使用 AMP.setState。它适用于普通 AMP 页面,但当将 amp story 添加到页面时,它不起作用。

这是code for the above mentioned experiment

请看看并提出一些合适的解决方案。 谢谢。

amp-storyamp-bind 不兼容。

故事有一个正在开发的实验性功能,称为 "branching",它允许用户通过将内容状态拆分到同一故事的不同页面来进行交互(请参阅 work in progress documentation)。

在您的示例中,您需要为用户创建单独的故事页面,以便他们在点击 Button 1Button 2Button 3 时登陆。分别