将Google AMP标签与Laravel Blade一起使用



我同时使用Google AMP(moustache.js(和Laravel Blade。根据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 中进行内联样式设置。

试试这个:

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

最新更新