打印

关于haml代码优化

关于haml代码优化



      - if tmdetail.comm.size == 0
        %th{:style=>"height: 12px"}
          =h tmdetail.fieldname
      - else
        %th{:style=>"height: 12px",:onmousemove=>"javascript:showMes(#{h add_quto(tmdetail.comm)})",:onmouseout=>"stopShow(this)"}        
          =h tmdetail.fieldname


上面一段是haml的代码,我的想法是让重复的代码去掉,有什么好的方法吗?

TOP

2008-11-22 20:37 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html) @38.103.63.61