将变量作为标签的 Jade 错误

Jade error putting variable as label

我得到了 jade 的错误 输入是自动关闭的,不应该有内容

input(type='radio') This discount has
   -if type == 1
    | #{value} %
   -else
    | RM #{value}

有什么想法吗?

您不能将内容放入输入中。这个html无效

<input type="radio">This discount has 0</input>

可能你想要

label
    input(type='radio') 
    | This discount has
    - if (type == 1)
      | #{value} %
    - else
      | RM #{value}  

或者

input(type='radio') 
span This discount has
- if (type == 1)
  | #{value} %
- else
  | RM #{value}