0.0.3 • Published 7 years ago

fis3-parser-translate-jst v0.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

fis3-parser-translate-jst

安装

全局安装或者本地安装都可以。

npm install fis3-parser-translate-jst

启用

在 fis-conf.js 中加入以下代码。

fis.match('/static/tmpl/**.jst', {
  parser: fis.plugin('translate-jst'),
  rExt: '.js'
}).match('/static/tmpl/**.{js, jst}', {
  isMod: true,
  packTo: '/static/components.js'
});

模板开发

hello.jst

  var hellp = 'Hello';
  <div>
    <% if(hello){ %>
      <%=hello%>,<%=name%>
    <% } %>
  </div>

main.jst

  var Hello = require('hello.jst');
  <div>
    <%=Hello({name:xu})%>
  </div>
0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago