问题描述
amp-bind-class 将“活动”类添加到活动按钮。 当我通过 chrome 开发人员工具看到它时,它工作得很好,但唯一的问题是 CSS 对它们不起作用。 我在 Next.js 中使用 AMP
{foo.map((item,i) => (
<button
className="pagination-buttons"
data-amp-bind-class={
"data.currentPage==" +
i +
"?'pagination-buttons active':'pagination-buttons'"
}
>
{i + 1}
</button>
))}
在点击任何按钮之前,它看起来像这样:
点击任意按钮后如下所示:
这是我点击后的 DOM
预期:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)