微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

[PUG] inputtype =“ submit”,value =“ Search”有什么问题:

如何解决[PUG] inputtype =“ 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

这是错误 input(type =“ submit” value =“ Search”) 这是有问题的代码。 有什么问题.... :( 请帮我:(
我重新安装了哈巴狗以对其进行修复,并修复了30分钟,但无法修复。

解决方法

Pug依靠缩进样式。这意味着它使用缩进来计算嵌套的标签或同级标签。您的情况input标签未正确嵌套。它应该与each块具有相同的缩进量。

each country in countries
    option(value=country.code)= `${country.flag} ${country.name}`
input(type="submit" value="Search" name="Search")

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。