用 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='';