缩进无效.玉模板

 如果阳光可以穿透心紧俏脏 发布于 2023-02-13 12:56

我知道我可以使用标签或空格,但不能同时使用两者.但我找不到无效缩进的位置.试过不同的变化.但我没有成功.添加后我得到了例外

- if (error)
p= error

所以我的代码如下所示:

!!!
html
head
    title= title
    link(rel='stylesheet', href='/stylesheets/#{stylesheet}.css')
    link(rel='stylesheet', href='/stylesheets/bootstrap.min.css')
body
    .container
        .row
            .col-md-4
            .col-md-4
                .well
                    - if (error)
                        p= error
                    form(role='form',action='sessions', method='post')
                        .form-group
                            label(for='Email') Eposta Adresi
                            input#Email.form-control(type='email',name='user[email]',placeholder='E-posta adresi')
                        .form-group
                            label(for='Password') ?ifre
                            input#Password.form-control(type='password',name='user[password]', placeholder='?ifre')
                        button.btn.btn-default(type='submit') Giri?

    script(type='text/javascript', src='/javascripts/jquery-1.10.2.min.js')
    script(type='text/javascript', src='/javascripts/bootstrap.min.js')

完全例外:

12| .well
13| - if (error)
> 14| p= error
15| form(role='form',action='sessions', method='post')
16| .form-group
17| label(for='Email') Eposta Adresi
Invalid indentation, you can use tabs or spaces but not both
at Object.Lexer.indent (C:\Nodejs\NodejsBlog\node_modules\jade\lib\lexer.js:691:15)
at Object.Lexer.next (C:\Nodejs\NodejsBlog\node_modules\jade\lib\lexer.js:789:15)
at Object.Lexer.lookahead (C:\Nodejs\NodejsBlog\node_modules\jade\lib\lexer.js:122:46)
at Object.Parser.lookahead     (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:116:23)
at Object.Parser.parseCode   (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:311:17)
at Object.Parser.parseExpr (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:225:21)
at Object.Parser.block (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:593:25)
at Object.Parser.tag (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:722:26)
at Object.Parser.parseTag (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:625:17)
at Object.Parser.parseExpr (C:\Nodejs\NodejsBlog\node_modules\jade\lib\parser.js:199:21)

需要建议.

1 个回答
  • 这是vim向我展示的:set list:

    ? ? ? ? .col-md-4¬
    ? ? ? ? .col-md-4¬
    ? ? ? ? ? .well¬
    ? ? ? ? ? ? - if (error)¬
        ? ? ? ? ?   ? p= error¬
    ? ? ? ? ? ? form(role='form',action='sessions', method='post')¬
    

    (三角形是标签)

    因此,您要在违规行上混合制表符和空格.

    2023-02-13 12:59 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有