1

amp-bindクラス属性をバインドするために使用しています:

<div [class]="menu.menuClass" class=hide">...</div>

次のamp-state要素を使用します。

<amp-state id="menu">
  <script type="application/json">
  {"menuClass":"hide"}
  </script>
</amp-state>

ただし、ページが読み込まれた後、次のエラーが表示されます。

amp-bind: Default value for [class] does not match first expression result (hide). This can result in unexpected behavior after the next state change.&#8203;&#8203;&#8203;

(このエラーはdivそれ自体に埋め込まれています)

ご覧のとおり、デフォルト値は最初の式と一致しています。私は何を間違っていますか?

4

1 に答える 1