【问题标题】:iframe embed with variable as src in pug is not workingiframe 在 pug 中嵌入变量作为 src 不起作用
【发布时间】:2017-04-15 06:16:42
【问题描述】:

这是使用 ejs 的代码:

<iframe width="660" height="371" src="<%= revive.reviveVideo %>"></iframe>

pug 中的 this 相当于什么?试过了,但没有用:

iframe(width='660', height='371', src='#{revive.reviveVideo}')

如果我将变量更改为实际路径,它就可以正常工作...这是变量语法的问题...

【问题讨论】:

    标签: node.js express pug ejs


    【解决方案1】:

    好的,我终于找到了:

    iframe(width='660', height='371', src=revive.reviveVideo)
    

    是 pug 的正确新语法

    【讨论】:

      猜你喜欢
      • 2013-04-11
      • 1970-01-01
      • 2015-09-06
      • 1970-01-01
      • 1970-01-01
      • 2017-05-21
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      相关资源
      最近更新 更多