[PUG]input(type= "submit" , value= "Search" ) 什么是问题 :(((


[nodemon] starting `ts-node src/index.ts`
✅I'm working on https://localhost:4010
Error: /mnt/c/Users/nyang/flock-phone/src/views/index.pug:14:1
12|                each country in countries
13|                    option(value=country.code)= `${country.flag} ${country.name}`
> 14|                 input(type="submit" value="Search" name="Search")
--------^
Inconsistent indentation. Expecting either 15 or 19 spaces/tabs.
at makeError (/mnt/c/Users/nyang/flock-phone/node_modules/pug-error/index.js:34:13)
at Lexer.error (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:62:15)
at Lexer.indent (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:1510:18)
at Lexer.callLexerFunction (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:1642:23)
at Lexer.advance (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:1683:12)
at Lexer.callLexerFunction (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:1642:23)
at Lexer.getTokens (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:1701:12)
at lex (/mnt/c/Users/nyang/flock-phone/node_modules/pug-lexer/index.js:12:42)
at Object.lex (/mnt/c/Users/nyang/flock-phone/node_modules/pug/lib/index.js:104:9)
at Function.loadString [as string] (/mnt/c/Users/nyang/flock-phone/node_modules/pug-load/index.js:53:24)
GET / 500 3902.067 ms - 1760

这是错误和输入(类型="提交"值="搜索"(这是有问题的代码。什么是问题……:(请帮我:(
我重新安装了pug来修复它,并修复了30分钟,但我无法修复它。

Pug依赖于缩进样式。这意味着它使用缩进来计算嵌套的标签或同级标签。在您的情况下,input标记嵌套不正确。它应该具有与each块相同的缩进。
each country in countries
option(value=country.code)= `${country.flag} ${country.name}`
input(type="submit" value="Search" name="Search")

最新更新