Backbone Jade 标签参数问题
Backbone with Jade issues with tag parameters
我面临着非常烦人的问题。我想使用 backbone 动态输入图像的 url。我认为以下内容可以。
img(src="<%= image %>" width="100%" height="auto")
然而,当我这样做时,src url 没有被正确替换并保持为“<%= image %>”:
this.$el.html(this.template(this.model.toJSON()));
有什么建议吗?
你可以这样写,并且有jade语法intact.This下划线变量可以直接引用的方式。
img(src!="<%= image %>" width="100%" height="auto")
我面临着非常烦人的问题。我想使用 backbone 动态输入图像的 url。我认为以下内容可以。
img(src="<%= image %>" width="100%" height="auto")
然而,当我这样做时,src url 没有被正确替换并保持为“<%= image %>”:
this.$el.html(this.template(this.model.toJSON()));
有什么建议吗?
你可以这样写,并且有jade语法intact.This下划线变量可以直接引用的方式。
img(src!="<%= image %>" width="100%" height="auto")