我正在创建一个nodejs应用程序,我使用的是玉引擎视图。
我使用引导程序,所以在翡翠中,我以以下方式导入它:
html
head
title=title
link(href('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', rel='stylesheet'))
body
div.container
div.jumbotron
h1 Hello!
if user
p Welcome, #{user.fullName}
p
a.small(href="profile") Edit my profile
a.btn.btn-primary(href="/logout") Logout
else
p Welcome to my app, ready to get started?
p
a.btn.btn-primary(href="/login") Login now
p
span.small Don't have an account=
span
a.small(href="/register") Register now不过当我做这个的时候。我得到以下错误:
SyntaxError: C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\views\home.jade:4
2| head
3| title=title
> 4| link(href('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', rel='stylesheet'))
Unexpected token )
at Function (<anonymous>)
at assertExpression (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\lexer.js:30:3)
at Object.Lexer.attrs (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\lexer.js:661:20)
at Object.Lexer.next (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\lexer.js:922:15)
at Object.Lexer.lookahead (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\lexer.js:113:46)
at Parser.lookahead (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\parser.js:102:23)
at Parser.peek (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\parser.js:79:17)
at Parser.tag (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\parser.js:752:22)
at Parser.parseTag (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\parser.js:738:17)
at Parser.parseExpr (C:\Users\user\Documents\SIGMA\NodeDotJS\real_examples\login-page\node_modules\jade\lib\parser.js:211:21)这个玉码有什么问题吗?我打开(我关闭它)。
发布于 2015-02-18 15:14:15
您只需要使用括号一次添加属性,然后添加它们,就像在HTML中一样,用逗号分隔。
link(href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', rel='stylesheet')https://stackoverflow.com/questions/28586900
复制相似问题