zoukankan      html  css  js  c++  java
  • jade的缩进真的是个坑

    初学者。。。失败的案例

    一定要注意jade的缩进,不要用tab,2个空格或者四个

    而且一定要按层级缩进。。。否则会影响它编译识别。。

    不知道有没有自动的format工具或者check的工具

    不然调了半天都不知道这么个原因

    太坑

    错误例:

    extends layout
    block content
    if (authenticated)
      p Welcome back, #(me.first)
      a(href="/logout") Logout
    else
      p Welcome new vistor!
      ul
        li: a(href="/login") Login
        li: a(href="/signup") Signup

    正确例:

    extends layout
    block content
      if (authenticated)
        p Welcome back, #(me.first)
        a(href="/logout") Logout
      else
        p Welcome new vistor!
        ul
          li: a(href="/login") Login
          li: a(href="/signup") Signup
    extends layout
    block content
      if (authenticated)
        p Welcome back, #(me.first)
        a(href="/logout") Logout
      else
        p Welcome new vistor!
        ul
          li: a(href="/login") Login
          li: a(href="/signup") Signup

    虽然就差一级缩进,却影响画面。。。

  • 相关阅读:
    repr() Vs str()
    默认参数
    元组
    字典
    电脑可以办的两类最基本的事情
    代码块
    变量名
    print的逻辑
    input的逻辑
    让python2听懂中文
  • 原文地址:https://www.cnblogs.com/qianyuqianxun/p/5096911.html
Copyright © 2011-2022 走看看