语法错误:/home/fzxa/work/blog2/views/articles/index.jade:7 [英] Syntax Error: /home/fzxa/work/blog2/views/articles/index.jade:7

查看:42
本文介绍了语法错误:/home/fzxa/work/blog2/views/articles/index.jade:7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Jade 模板的第 7 行出现语法错误:

I am getting syntax error at line 7 of my Jade template:

 5| div#articles
 6|   - if(articles.length)
 7|     !=partial('article_list', {collection : articles, as : 'article'})
 8|   - else
 9|     #no-results No articles found. Create one
10|       a(href="/articles/new") here

有人知道为什么吗?

推荐答案

问题出在 article_list 部分视图中.该代码使用了保留的类"一词.在article_list.jade 更改

The issue is in the article_list partial view. The code is using the word "class" which is reserved. In article_list.jade change

- if(lastInCollection)
  - class = 'last'
- else
  - class = ''
div(class="article #{class}")

- if(lastInCollection)
  - cls = 'last'
- else
  - cls = ''
div(class="article #{cls}")

这篇关于语法错误:/home/fzxa/work/blog2/views/articles/index.jade:7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆