[英]Unexpected token 'Indent' using jade and Eclipse
我正在尝试学习节点,角度,javascript,表达和玉器。 对我来说,这完全来自基于.net的严格代码环境。
所以我找到了一个教程,但是在第二步中我遇到了麻烦。 现在,这是我在制作新项目时在Eclipse自动创建的index.jade文件中完成的教程中的直接复制粘贴。
我将以下代码插入文件
doctype 5
html(lang='en)
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width,initial-scale=1, user-scalable=no')
title= title
link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
body
nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
div.navbar-header
a.navbar-brand(href='#/polls')= title
div.container
div
而且我在html的头部附近收到了意外的令牌“缩进”错误。 现在,我对使用Eclipse和Jade非常满意,我不知道该怎么做。 我已经搜索了stackoverflow,但似乎找不到与我的问题完全一样的人,所以我很迷路。 任何提示将不胜感激。
您的文档应该开始时没有任何空格(在文档的左侧开始),这可能是copypaste的副作用,这是它的外观:
doctype html
html
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width,initial-scale=1, user-scalable=no')
title= title
link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
body
nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
div.navbar-header
a.navbar-brand(href='#/polls')= title
div.container
div
评论的答案:
如果这与代码内部的样子完全一样,则需要取消所有代码的缩进,然后它就会起作用。 翡翠代码无法开始缩进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.