我在项目中使用Amp社交分享.社交共享功能正在按预期工作,但在验证后,我收到以下错误:
The tag 'amp-social-share' is disallowed.
在我的标题中,我链接到: https://cdn.ampproject.org/v0/amp-social-share-0.1.js
在身体我包括多个<amp-social-share>组件:
<div class="social-share">
<amp-social-share type="pinterest" width="35" height="35" data-text="MY_TEXT" data-url="MY_URL" data-attribution="MY_ATTR">
<div>
<a class="custom">MY_SVG</a>
</div>
</amp-social-share>
<amp-social-share type="twitter" width="35" height="35" data-text="MY_TEXT" data-url="MY_URL" data-attribution="MY_ATTR">
<div>
<a class="custom">MY_SVG</a>
</div>
</amp-social-share>
<amp-social-share type="facebook" width="35" height="35" data-text="MY_TEXT" data-url="MY_URL" data-attribution="MY_ATTR">
<div>
<a class="custom">MY_SVG</a>
</div>
</amp-social-share>
<amp-social-share type="gplus" width="35" height="35" data-text="MY_TEXT" data-url="MY_URL">
<div>
<a class="custom">MY_SVG</a>
</div>
</amp-social-share>
</div>
Run Code Online (Sandbox Code Playgroud)
据我所知,这些是按照此处的规范设置的:https://github.com/ampproject/amphtml/blob/master/extensions/amp-social-share/amp-social-share.md
有什么我想念的东西可以帮助我验证这个组件吗?
验证错误的原因The tag 'amp-social-share' is disallowed是因为amp-social-share是一个实验性组件,尚未在验证器中.这令人困惑,因为它目前被列为ampproject.org上的"扩展组件".
另请注意,通用类名称twitter可能会更改为更具描述性的名称,例如amp-social-share-twitter.请参阅https://github.com/ampproject/amphtml/issues/1201