aui / tmodjs

前端模板外置解决方案
666 stars 189 forks source link

使用tmodjs生成模板文件后调用数据时却无法显示数据? #69

Closed landy2014 closed 9 years ago

landy2014 commented 9 years ago

具体的我描述不是很好描述,上图吧。 我使用的是art-template的原生语法来写模板的。 这是编译前的模板文件 header.html:

  • <\%=name\%>

这是编译后的模板文件:template.js define(function(require) { return require("./template")("header", function($data) { "use strict"; var $utils = this, $escape = ($utils.$helpers, $utils.$escape), name = $data.name, $out = ""; return $out += "

  • ", $out += $escape(name), $out += "
", new String($out); }); });

下面是我在index.html页面上使用seajs调用:

运行后浏览器console显示如下:

li标签里面的数据显示不出来了。 今天才刚开始使用tmodjs,不是很明白为什么,希望能得到解答,谢谢。

landy2014 commented 9 years ago

贴了些html代码,被转换了。我截图吧,不好意思。