css因 laytpl失效

提问 未结 8 319
吃毛的鱼
吃毛的鱼 2019-4-30
悬赏:20飞吻
版本:layui 浏览器:
页面: <script type="text/html" id="whisper-item">
{{# layui.each(d.list,function(index,item){}}
<div class="item-box" style="margin-bottom:20px">
<div class="item">
<div class="whisper-title">
<i class="layui-icon layui-icon-username"></i> <span class="author">{{item.Author}}</span><i class="layui-icon layui-icon-date"></i><span class="hour">{{item.date}}</span>

js方法:
var whisper = document.getElementById("whisper-item").innerHTML,
whisperview = document.getElementById("whisper-list-id");
laytpl(whisper).render(data, function (html) {
whisperview.innerHTML = html;
});
form.render()
用了laytpl模板方法哈后, <div class="item-box" style="margin-bottom:20px">这个margin就失效了,我也不知道为啥,不用这个laytpl写成静态页面就能让margin有用
回帖