pug新手学习

感觉自己有段时间没有跟新了,唉,只是一直找不到可以写的必要

其实我一直对pug特别感兴趣的,安装点我

记得全局安装pug和pug-cli就行了

在webstorm配环境记得在前面加-P

  1. a: img  内联式语法
  2. input/ 自闭合
 button.btn.btn-tt.btn-aaa(type="button") #[div 123]
 ='\n'
 div#foo(data-bar='foo' checked) 这里面也可以写文字 #[div]
  ul
        each val in [1,2,3,4,5]
            li=val
 //  ------插入css/js/html
    style
        include style.css
    script
        include script-1.js
    html
        include 222.pug
    p
        | 其实我这也是能写东西的 #[a(href="#")]
    p 我是不是可以再可以写内容
            include 222.pug  
    在标签里插入其他内容
    - var title = "还是我写写中文吧";
    h1=title
    - var author="enlore";
    p #{author}
    - ttt='https://exampla.com';
    a(href=ttt) 按照这样的语法写就行了
        

posted @ 2018-02-06 22:39  猫神甜辣酱  阅读(511)  评论(0编辑  收藏  举报