<var id="bd95f"></var>
<ins id="bd95f"></ins>
<ins id="bd95f"></ins>
<var id="bd95f"><noframes id="bd95f">
<ins id="bd95f"><span id="bd95f"></span></ins>
<ins id="bd95f"></ins>
<ins id="bd95f"></ins>
ҳ > > վŻ >

laytpl jsģ

վ༭ 2020-03-14 21:32 / վ /
ļ
<script src="../js/laytpl.js"></script>
//һдģʹһscriptǩģ磺
<script id="demo" type="text/html">
  <h3>{{ d.title }}</h3>
  <ul>
  {{#  layui.each(d.list, function(index, item){ }}
    <li>
      <span>{{ item.modname }}</span>
      <span>{{ item.alias }}</span>
      <span>{{ item.site || '' }}</span>
    </li>
  {{#  }); }}
  {{#  if(d.list.length === 0){ }}
    
  {{#  } }} 
  </ul>
</script>
 
//ڶͼڳȾ
<div id="view"></div>
 
//Ⱦģ
var data = { //
  "title":"Layui"
  ,"list":[{"modname":"","alias":"layer","site":"layer.layui.com"},{"modname":"","alias":"form"}]
}
var getTpl = demo.innerHTML
,view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
  view.innerHTML = html;
});
ۺɫͼƬ,18videosexŷ69,ְֵĴҵĴѽ,ӡȷʸëbbw