AMP 一键快捷组件已弃用。这意味着新的 Web 应用不应使用此组件,而现有应用的开发者应按照
迁移指南进行所有必要的更改,以免对用户登录其网站造成负面影响。
在 AMP 网页中显示一键显示功能
如需向您的 AMP 网页添加一键式登录,请执行以下操作:
将 One Tap 添加到您自己网站上托管的中间 iframe。
使用 <amp-onetap-google>
组件将中间 iframe(而非 One Tap)嵌入到 AMP 页面中。
将以下代码段放置在您希望 Google One Tap 显示的任何 AMP 网页中:
<script custom-element="amp-onetap-google" src="https://cdn.ampproject.org/v0/amp-onetap-google-0.1.js" async></script>
<amp-onetap-google
layout="nodisplay"
data-src="https://example.com/onetap_iframe.html">
</amp-onetap-google>
将 data-src
属性设置为中间 iframe 的 URI。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-20。
[null,null,["最后更新时间 (UTC):2024-09-20。"],[[["Google One Tap can be integrated into Accelerated Mobile Pages (AMP) using an intermediate iframe hosted on your website."],["Instead of directly embedding One Tap, embed this intermediate iframe into your AMP pages using the `\u003camp-onetap-google\u003e` component."],["You need to include a specific script tag and the `\u003camp-onetap-google\u003e` tag within your AMP pages, pointing the `data-src` attribute to your iframe's URL, for One Tap to function correctly."]]],[]]