cssmagic / underscore-template

More APIs for Underscore's template engine.
10 stars 3 forks source link
api cache render template template-engine underscore underscore-template-engine

Underscore-template

More APIs for Underscore's template engine - template fetching, rendering and caching.

简介

著名的 JavaScript 工具库 Underscore 内置了一个小巧而完备的前端模板引擎,而 Underscore-template 对它进行了封装和增强,将它更好地融入了开发流程:

兼容性

依赖以下类库:

支持以下浏览器:

安装

  1. 通过 Bower 安装:

    $ bower install underscore-template
  2. 在页面中加载 Underscore-template 的脚本文件及必要的依赖:

    <script src="https://github.com/cssmagic/underscore-template/raw/master/bower_components/underscore/underscore.js"></script>
    <script src="https://github.com/cssmagic/underscore-template/raw/master/bower_components/underscore-template/src/underscore-template.js"></script>

API 文档

单元测试

  1. 把本项目的代码 fork 并 clone 到本地。
  2. 在本项目的根目录运行 bower install,安装必要的依赖。
  3. 在浏览器中打开 test/test.html 即可运行单元测试。

谁在用?

移动 UI 框架 CMUI 采用 Underscore-template 作为轻量的前端模板解决方案,因此所有 CMUI 用户都在使用它:


License

MIT License