相关疑难解决方法(0)

Next.JS + AMP CSS

我在 Next.js 中使用 AMP 和 CSS 时遇到问题。在我的头部组件中,我有:

<Head>
    <style amp-custom>{`
        // CSS Here
    `}</style>
</Head>
Run Code Online (Sandbox Code Playgroud)

在 HTML 源代码中,它显示为<style amp-custom=""></style><style>(CSS Here)</style>

在控制台中我收到此错误:The mandatory attribute 'amp-custom' is missing in tag 'style amp-custom (transformed)'.

如何在 CSS 和 Next 上使用 AMPHTML 规则?我尝试过的所有其他方法(例如使用 @zeit/next-sass 从文件导入)都会导致 CSS 根本无法渲染。这是我发现的唯一有效版本。

css reactjs react-native amp-html next.js

3
推荐指数
1
解决办法
4926
查看次数

标签 统计

amp-html ×1

css ×1

next.js ×1

react-native ×1

reactjs ×1