Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lovetingyuan/simple_template
简单的模板编译
https://github.com/lovetingyuan/simple_template
compiler html javascript template
Last synced: about 1 month ago
JSON representation
简单的模板编译
- Host: GitHub
- URL: https://github.com/lovetingyuan/simple_template
- Owner: lovetingyuan
- License: mit
- Created: 2017-03-20T10:29:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-21T08:09:05.000Z (almost 8 years ago)
- Last Synced: 2024-10-30T03:23:19.419Z (3 months ago)
- Topics: compiler, html, javascript, template
- Language: JavaScript
- Homepage: https://lovetingyuan.github.io/simple_template/
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple_template
简单的模板编译example: [jsfiddle: todo_list](https://jsfiddle.net/tingyuan/ffgmn1hy/)
支持:
* 双花括号表达式绑定 {{ expression }}
* 条件编译 {{ if(expression) content }}
* 列表循环 {{ for(expression) content }}
* 模板变量 {{ var(expression) content }}
* 局部作用域 {{ with(expression) content }}
* 忽略编译输出 {{ ! content }}
* 事件绑定 {{ <div onclick="{{@handler}}"></div> }}
* 自定义方法 {{ foo(arg1, arg2, ...) }}todo:
* 安全问题(未对模板做安全过滤和转义)
* 性能问题(模板全量更新)