玉不渲染复选框文本?

时间:2012-08-05 15:05:36

标签: html checkbox pug

我试图使用编译的jade将chekcboxes输入放在我的html文件中,它会呈现实际的复选框而不是文本,即

          p.confirm
            input(type="checkbox", name="agree") 
              | I agree to the Terms & Conditions of this Company <br />
            input(type="checkbox", name="subscribe") 
              | Tick to recieve future communication from Company

我尝试了玉器文档,但没有任何反应,谢谢

2 个答案:

答案 0 :(得分:23)

我不确定接受的答案是如何工作的,因为如果没有转义,Jade会将文本解释为标签。

这两种方法都可以改为:

p.confirm
  label
    input(type="checkbox", name="agree")
    | I agree to the Terms & Conditions of this Company
  br
  label
    input(type="checkbox", name="subscribe")
    = " Tick to recieve future communication from Company"
需要

标签才能使文字可点击。

答案 1 :(得分:3)

输入标签没有子女。

p.confirm
    input(type="checkbox", name="agree")
    I agree to the Terms & Conditions of this Company
    br
    input(type="checkbox", name="subscribe")
    Tick to recieve future communication from Company
相关问题