无法在 pugjs 中包含以下代码。我收到错误。
<body>
<amp-state id="theFood">
<script type="application/json">
{
"cupcakes": {
"imageUrl": "https://amp.dev/static/samples/img/image2.jpg",
"style": "greenBorder"
},
"sushi": {
"imageUrl": "https://amp.dev/static/samples/img/image3.jpg",
"style": "redBorder"
}
}
</script>
</amp-state>
我在 pugjs 中转换为
amp-state#theFood
script(type="application/json").
{
"cupcakes": {
"imageUrl": "https://amp.dev/static/samples/img/image2.jpg",
"style": "greenBorder"
},
"sushi": {
"imageUrl": "https://amp.dev/static/samples/img/image3.jpg",
"style": "redBorder"
}
}
但我收到以下错误。pugjs 不支持 JSON 格式吗?我错过了什么?
简短的完整错误信息