AMP HTML是否允许使用非官方的自定义元素 [英] Does AMP HTML allow unofficial custom elements

查看:155
本文介绍了AMP HTML是否允许使用非官方的自定义元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AMP页面可以使用非官方的自定义组件吗?

Will an AMP page work with an unofficial custom component?

我可以想像得到一个官方网站最适合推广使用,但是对于一个想要在某个自定义组件中进行编程的网站来说,它是否需要将其组件批准为官方网站,或者可以制作一个并包含在自己的组件中代码?

I can imagine getting an official one is best for spreading usage but for just 1 site which wants to program in some custom component does it need to get its component approved as official or it can just make one and include it in its own code?

https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md

推荐答案

否.一个非官方的自定义组件将不得不破坏符合AMP的内容可能没有任何JavaScript".约束.

No. An unofficial custom component would have to break the "AMP-conforming content may not have any JavaScript." constraint.

我建议按照组件内置的特定于服务的JavaScript"部分中所述的方法进行操作:

I'd suggest either following the approach described in the "Service-specific JavaScript built-in to a component" section: https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md or working with the project to get your desired component included.

这篇关于AMP HTML是否允许使用非官方的自定义元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆