简体   繁体   中英

How can I do this in Jade (pug)?

<ul class="dropdown-menu">
  <li>
    <a href="javascript:void(0)">
      <i class="ti-user m-r-5"/>
      Profile
    </a>
  </li>
</ul>

I don't know how to put i and " Profile " in a . Please help me!

I found that the inline tags can solve it!

ul(class='dropdown-menu')
  li #[a(href="javascript:void(0)") #[i(class=['ti-user', 'm-r-5'])] Profile]

You can use online service to convert HTML to Jade, for example: http://html2jade.org/

Here is an answer:

html
  body
    ul.dropdown-menu
      li
        a(href='javascript:void(0)')
          i.ti-user.m-r-5
            | Profile

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