Jade indentation errors

前端 未结 3 956
有刺的猬
有刺的猬 2021-01-31 23:25

So for my Express site, I\'m using jade. So I decided to try modifying my layout file so I can start designing my site. I modified the original layout code (which worked), but I

相关标签:
3条回答
  • 2021-01-31 23:53

    for edit form on server.js file set variable like this

    var applications = row;
    res.render("edit", { applications : applications[0] }); 
    

    for edit.jade file :

    block content
    table
        thead
          tr
            th First Name
            th Last Name
        tbody
          - each item in applications
            tr
              td= item.username
              td= item.email
    
    0 讨论(0)
  • 2021-02-01 00:01

    This answer is an extension to the answer of André Dion (I don't have enough reputation to comment on his post). One can also do the same procedure he described in Visual Studio Code Directly. If you use Pug in Visual Studio Code it will be very nice.

    0 讨论(0)
  • 2021-02-01 00:19

    In the lower right-hand corner of Sublime Text, there should be a label that says Spaces: N or Tab Size: N where N is a number. Select this and you'll see options to convert the entire document's indentation to use either tabs or spaces:

    • Convert Indentation to Spaces
    • Convert Indentation to Tabs
    0 讨论(0)
提交回复
热议问题