Pug dynamic image src interpolation

萝らか妹 提交于 2021-02-08 19:29:05

问题


I have stored a dynamic url link into a pug variable #{img}. Now I want to include that variable into my image element. Can anyone help me fill in the blank?

#{img} //some dynamic url
img(src=" ") //want to set src = #{img}

回答1:


do it like this

- var img = "img/test.jpg"
img(src=img)

and read this



来源:https://stackoverflow.com/questions/47483937/pug-dynamic-image-src-interpolation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!