我在我的jade文件中使用了mixin。要求是有两个div。如果我只创建一个DIV它呈现,但如果我用两个混入渲染我得到错误的内容:“未定义jade_mixins.selectedImage卡是不是一个函数”JADE/PUG:无法使用两个mixin
这里是玉代码:
.container
.allThumbs
h2 All
.row
mixin allImage-card(photo)
.col-lg-4.col-md-4.col-sm-4.col-xs-6
.imgThumb
img.thumb(src=photo.URL, alt="")
for photo in _allPhotos
+allImage-card(photo)
.allThumbs
h2 Selected
.row
mixin selectedImage-card(photo)
.col-lg-4.col-md-4.col-sm-4.col-xs-6
.imgThumb
img.thumb(src=photo.URL, alt="")
for photo in _selected
+selectedImage-card(photo)
你应该把混入代码的缩进之外,这样的事情: –