简体   繁体   中英

Jade error putting variable as label

I got an error of jade input is self closing and should not have content .

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

Any idea?

You cant put content insade input. This html is invalid

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

Probably you want

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

Or

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM