在Laravel Blade中使用Google AMP标签

时间:2018-09-13 09:01:19

标签: php laravel laravel-blade google-amp

我同时使用Google AMP(moustache.js)和Laravel Blade。 According to Laravel,我要做的就是在方括号之前添加@

我可以这样做:

<!-- Grid-->
<amp-list width="auto"
  height="100"
  layout="fixed-height"
  src="/api/activity/all"
  [src]="acts.data"
  class="m1"
  items="data">
  <template type="amp-mustache">
    <amp-img width="108" height="70" src="@{{cover}}"></amp-img>
  </template>
</amp-list>

但是,在内联样式中添加AMP列表呈现的值不起作用。

<div style="background-image:@{{cover}}; width: 100%; height: 400px; "></div>

顺便说一句...现在可以在AMP中进行内联样式了。

1 个答案:

答案 0 :(得分:0)

尝试:

<div style="background-image: url('@{{cover}}'); width: 100%; height: 400px; "></div>