如何在帕格模板中设置图像来源的变量?

问题描述 投票:0回答:1

[创建电影信息平台时,我想打印图像海报。我无法将图像的来源设置为pug中的变量。

      each movie in movies
         .col-md-3(style="margin-bottom: 20px;")
             .text-center
                img(src= "#{movie.Poster}" style="width:100%; height:200px; padding: 0px 40px;")
                    h5(style="padding: 5px 40px 0px 40px;") #{movie.Title}
                    h5 #{movie.Year}
html image pug
1个回答
0
投票

我认为您应该尝试:

- var movie.Poster = "img/someImage.jpg"
img(src=img)

您可以阅读here

© www.soinside.com 2019 - 2024. All rights reserved.