unexpected token "indent"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/you23hai45/article/details/86609775

1、错误描述

F:\dojo\abcd\abcc\views\login\login.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:\dojo\abcd\abcc\views\login\login.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:\dojo\abcd\abcc\node_modules\pug-error\index.js:32:13)
    at Parser.error (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:53:15)
    at Parser.parseExpr (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:257:14)
    at Parser.parse (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:112:25)
    at parse (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:12:20)
    at Object.parse (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:126:22)
    at Function.loadString [as string] (F:\dojo\abcd\abcc\node_modules\pug-load\index.js:45:21)
    at compileBody (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:86:18)
    at Object.exports.compile (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:243:16)
    at handleTemplateCache (F:\dojo\abcd\abcc\node_modules\pug\lib\index.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')

猜你喜欢

转载自blog.csdn.net/you23hai45/article/details/86609775
今日推荐