1、错误描述
F:dojoabcdabccviewsloginlogin.pug:3:1 1| doctype html 2| > 3| h1= title -------^ 4| p Welcome to #{title} 5| div(class='div_style') unexpected token "indent"
Error: F:dojoabcdabccviewsloginlogin.pug:3:1
1| doctype html
2|
> 3| h1= title
-------^
4| p Welcome to #{title}
5| div(class='div_style')
unexpected token "indent"
at makeError (F:dojoabcdabcc
ode_modulespug-errorindex.js:32:13)
at Parser.error (F:dojoabcdabcc
ode_modulespug-parserindex.js:53:15)
at Parser.parseExpr (F:dojoabcdabcc
ode_modulespug-parserindex.js:257:14)
at Parser.parse (F:dojoabcdabcc
ode_modulespug-parserindex.js:112:25)
at parse (F:dojoabcdabcc
ode_modulespug-parserindex.js:12:20)
at Object.parse (F:dojoabcdabcc
ode_modulespuglibindex.js:126:22)
at Function.loadString [as string] (F:dojoabcdabcc
ode_modulespug-loadindex.js:45:21)
at compileBody (F:dojoabcdabcc
ode_modulespuglibindex.js:86:18)
at Object.exports.compile (F:dojoabcdabcc
ode_modulespuglibindex.js:243:16)
at handleTemplateCache (F:dojoabcdabcc
ode_modulespuglibindex.js:216:25)
2、错误原因
在主体内容前,需要添加block content,用作标识开始
doctype html
h1= title
p Welcome to #{title}
div(class='div_style')
3、解决办法
doctype html
block content
h1= title
p Welcome to #{title}
div(class='div_style')