导航栏: 首页 评论列表

artTemplate 的 include 的 bug

默认分类 2015/09/11 06:46

用 art template 做了一个小demo, 发现include方法有bug

<script id="header" type="text/html">
header
</script>
<script id="footer" type="text/html">
footer
</script>

使用 include

<script id="body" type="text/html">
{{include('header')}}
body
{{include('footer')}}
</script>

正确结果

header
body
footer

实际结果

header
body
header
body
footer

解决方案1:

<script id="body" type="text/html">
{{include 'header'}}
body
{{include 'footer'}}
</script>

解决方案2:

template-debug.js          
template-native-debug.js   
template-native.js         
template.js                
compile.js                 

其中

function(filename,data){
改成
function(filename,data){var $out='';


>> 留言评论